Side lenght - area - combinations calculator. Help needed - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Side lenght - area - combinations calculator. Help needed

matasrudokasmatasrudokas LithuaniaPosts: 1Member

Hello, everyone. I'm writing a program which finds all possible side lengths of quadrangle to match specified area. I've checked the code - everything works, except the part (it's in bold), where the program has to write matching pair of quadrangle side lengths.

program Area; var x, y, S, n: real; begin WriteLn('Enter quadrangle area:'); ReadLn(S); WriteLn('Enter accuracy:'); ReadLn(n); x:=n; y:=n; WriteLn; WriteLn('Calculating possible lenghts of quadrangle sides...'); While (xy<>S) and (y<=(S/n)) and (x<=S) do begin If x+n<=S then x:=x+n else begin x:=n; y:=y+n; End; ** If xy=S then WriteLn(x:0:2,' ; ', y:0:2);** End; WriteLn; WriteLn('Calculation has been finished.'); ReadLn; end.

What's wrong there? Could be a compiler bug or something other?

Comments

  • matasrudokasmatasrudokas LithuaniaPosts: 1Member

    program Area; var x, y, S, n: real; begin WriteLn('Enter quadrangle area:'); ReadLn(S); WriteLn('Enter accuracy:'); ReadLn(n); x:=n; y:=n; WriteLn; WriteLn('Calculating possible lenghts of quadrangle sides...'); While (xy<>S) and (y<=(S/n)) and (x<=S) do begin If x+n<=S then x:=x+n else begin x:=n; y:=y+n; End; ** If xy=S then WriteLn(x:0:2,' ; ', y:0:2);** End; WriteLn; WriteLn('Calculation has been finished.'); ReadLn; end.

  • remediosvaroremediosvaro ThailandPosts: 2Member

    Hello great programmers.. is there any categpry here for out the box thing, something natural.. something linked to painting??? If want something real,., visit "remediosvaro.biz", or stay here.. involved ikn programming, gud luck . ..

Sign In or Register to comment.