How do you use " for each number from .. to .. by .. " trial method?

I have the area = given in textbox by user

and I have the Width = given in textbox by user

I want to calculate the Length using the relationship Area = Length * width

but i want to get the Length by trial using ( for each number from to by ) block

I tried as in the picture but it did not work

//This is a simple example just to illustrate the idea//

You will never get an exact match with an increment of 0.001 in a system that uses binary floating point math

The best you can hope for is to search for the minimum error.

1 Like

(the exact correct number would be 2.653846153846154, but like @ABG has said you can get an aprox.)

1 Like

thank you it worked :smiling_face_with_three_hearts:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.