Monday, December 10, 2007

How to work with REPEAT...UNTIL by example

How to work with REPEAT...UNTIL by example

To work with REPEAT...UNTIL by example

Example:

program Welcome;

uses

Wincrt;

var

x:real;

y:real;

begin

Writeln('Table of Function Values ');

Writeln;

Writeln;

Writeln(' average ',' value of formula ',' status ');

x:=0.00;

Repeat

y:=(x*x*x+7*x-1)/(x*x-(x+5)/3);

Writeln;

Write(x,'',y);

if y>=0 then Write(' Admit ');

Writeln;

x:=x+0.50

Until x >=4.00;

Writeln;

Writeln('The table is finished ');

end.

Output:

No comments: