Saturday, October 8, 2016

Reverse a Number Using While Loop Using Turbo Pascal

A simple program that wrote using Turbo Pascal For Windows to accept a series of numbers and then our program will reverse the arrangement of the number being provided by the user.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

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

Program Revese_Num_Using_while_loop;
Uses WinCrt;

Var
  N,R : Longint;
  
Begin
 Clrscr;
 Write('Reverse a Number Using While Loop Using Turbo Pascal');
 Writeln;
 Writeln;
 Writeln;
 Write('Give a Number : ');
 Readln(N);
 Writeln; Writeln;
 Write('The Reversed Number :==> ');

  While (N<>0) Do
     Begin
  R := N mod 10;
  Write(R);
  N := N Div 10;
End;
Writeln;
Writeln;
Write('End of Program');
Readln;
End.



No comments:

Post a Comment