Thursday, March 23, 2017

Odd and Even Number Checker in Turbo Pascal

Here is a sample program that will ask the user to give a number and then our program will determine if the given number is an odd or even number using Pascal as our programming language. I am using Turbo Pascal for Windows in this sample program. Thank you.


My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Sample Program Output


Program Listing

{ Written By: Mr. Jake R. Pomperada, MAED-IT                           }
{ Date : March 23, 2017    Thursday                                               }
{ Metro Manila, Philippines                                                              }
{ jakerpomperada@yahoo.com and jakerpomperada@gmail.com }

Program even_odd_numbers;

Uses WinCrt;

Var N, R : Integer;

Begin
clrscr;
 N := 0;
 R := 0;

 writeln('EVEN AND ODD NUMBER CHECKER IN PASCAL');
 writeln;
 Write('Give a Number : ');
 Readln(N);
 R := (N MOD 2);
   if (R=0) then
   Begin
     Writeln;
     Write('The given number ' ,n,' is EVEN number.');
   End
  Else
    Begin
        Writeln;
        Write('The given number ' ,n,' is ODD number.');
    End;
 writeln;
 writeln;
 Writeln;
 writeln('  END OF PROGRAM  ');
readln;
End.


No comments:

Post a Comment