Here is a sample program that I wrote using Pascal as my programming language that will ask the user to give a number and then our program will check whether the give number of the user is a positive or negative number after which our program will ask the user if the user will continue using the program or not. This program that I wrote is very simple it brings back the memories during my college day's when I am taking up Pascal programming I am using Turbo Pascal 6.0 as my Pascal compiler in this program.
If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
Program Positive_and_Negative_Numbers;
Uses Crt;
Var Number : Integer;
Ch : Char;
Begin
Clrscr;
Repeat
Writeln;
Number := 0;
Writeln('Positive and Negative Number Checker in Pascal');
Writeln;
Writeln;
Write('Enter a Number : ');
Readln(Number);
If (Number >=0) Then
Begin
Writeln(Number ,' is a Positive Number. ');
Writeln;
End
Else
Begin
Writeln(Number,' is a Negative Number. ');
Writeln;
End;
Writeln;
Write(' Do you want to continue y/n ?');
Ch := Upcase(readkey);
Until Ch = 'N';
Writeln;
Writeln;
Write('Thank You For Using This Software.');
Readln;
End.
No comments:
Post a Comment