Here is a sample program that I wrote using Turbo Pascal for Windows to ask the user the radius of the circle and then our program will compute the area of the circle.
Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
Program area_of_the_circle;
Uses WinCrt;
Const
Pi = 3.1416;
Var
Choice : Char;
radius : Integer;
Procedure convert_area(var radius : integer);
Var
Area : real;
Begin
Area := Pi * Radius * Radius;
writeln('The Radius is ',Area:8:2);
End;
Begin
Clrscr;
Choice := 'Y';
Write('Area of the Circle Converter');
Writeln;
Writeln;
While upcase(Choice) = 'Y' Do
Begin
Writeln;
Write('Enter the area of the circle : ');
Readln(radius);
Writeln;
convert_area(radius);
Write('Continue [Y/N] ');
readln(choice);
Writeln;
End;
Writeln;
Write('End of Program');
Writeln;
Readln;
End.
Uses WinCrt;
Const
Pi = 3.1416;
Var
Choice : Char;
radius : Integer;
Procedure convert_area(var radius : integer);
Var
Area : real;
Begin
Area := Pi * Radius * Radius;
writeln('The Radius is ',Area:8:2);
End;
Begin
Clrscr;
Choice := 'Y';
Write('Area of the Circle Converter');
Writeln;
Writeln;
While upcase(Choice) = 'Y' Do
Begin
Writeln;
Write('Enter the area of the circle : ');
Readln(radius);
Writeln;
convert_area(radius);
Write('Continue [Y/N] ');
readln(choice);
Writeln;
End;
Writeln;
Write('End of Program');
Writeln;
Readln;
End.
No comments:
Post a Comment