Hi there in this article I would like to share with you a sample program that I wrote using Pascal as my programming language to check if the given number by the user is a positive or negative number. In this sample program I am using Turbo Pascal 5.0 as my compiler.
Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
Program Positive_Negative;
Uses Crt;
Var Number : Integer;
Begin
Clrscr;
Write('Positive and Negative Number Checker');
writeln;
writeln;
Write('Enter a Number : ');
readln(Number);
if (number >=0) then
Begin
Writeln;
Writeln(Number, ' is a Positive Number.');
End
else
Begin
Writeln;
Writeln(Number, ' is a Negative Number.');
End;
Readln;
End.
No comments:
Post a Comment