Monday, December 10, 2007

How to work with While by example

How to work with While by example

To work with While 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;

While x <=4.00 do

begin

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

end;

Writeln;

Writeln('The table is finished ');

end.

Output:

No comments: