• Image 1
  • Image 2
  • Image 3
  • Image 4
  • Image 5
  • Image 6
  • Image 7




Friday, August 17, 2012

TURBO PASCAL - EVEN-ODD PROGRAM

Hi.. welcome to my page in We Are Knowledge.. In here you will getting many IT knowledge.. likely dekstop programming knowledge.. and now I want giving you knowledge “PASCAL” ..

I was made Program and I give name “even-odd program”. Yeah likely of name, if you input a number then to appear, whether the number is even or odd..

I using command “DIM”.. DIM in pascal is command for to result value from remainder a number..

Ok.. you can copy this coding, andpaste in your aplication… or you can copy this coding and paste in notepad, and don’t forget save with saveas type ex = “wak.pas”.


Example 1:

uses crt;
var
a : integer;
label
try, out;
begin
try:
clrscr;
writeln ('Hello.... !!, Welcome in');
writeln ('  We Are Knowledge');
writeln ('   Lets try this');
writeln (' Have Fun And Enjoyed');
writeln;
writeln;
write ('Please Input Your Number : ');
readln(a);
if a mod 2 = 0 then
writeln ('Your Input Number is EVEN Number')
else
writeln ('Your Input Number is ODD Number');
readln;
writeln;
writeln;
writeln (' You Will Try ?');
writeln ('1. Yes ||| 2. No');
readln (a);
if a = 1 then goto try
else
goto out;
out:
end.


To result :

If you input number even like as : 2, 10, 200, 700, 568, and other…
Then to appear >>
Your Input Number is EVEN Number

If you input number even like as : 3, 99, 587, 101, 565, and other…
Then to appear >>
Your Input Number is ODD Number

And next, I was making syntax for try the program without closing program…

If you in options

You Will Try ?
1. Yes ||| 2. No

Your choice = 1.. then you want back to program
Your choice = 2 then you want out from program..



NOTE ::

if you using copy and paste please change all quotes (" ") or (' ').


Ok… just it ….
I hope you understand…
Thanks for visitors and readers..
See you laters

No comments:

Post a Comment