PDA

Click to See Complete Forum and Search --> : Pascal: printing 3-digit number in reverse order


kazooie21
Jan 23rd, 2000, 10:29 AM
I need a Pascal program that allows the user
to enter a three-digit number and the number will print in reverse order. The reverse number should use a variable and it shouldn't print each of the digits separately.

Keiko
Jan 23rd, 2000, 12:23 PM
kazooie21,

I don't really remember the whole syntax
(long time I've never used Pascal),
hope this can help

---------

var mystring = string;
d1, d2, d3 = integer;

uses crt;

Begin


write "please enter digit 1";
readln (d1);
write "please enter digit 2";
readln (d2);
write "please enter digit 3";
readln (d3);
mystring = str(d3) + str(d2) + str(d1)
writeln "result = " + mystring

readkey;

End

-------

By the way this is VB forum

Regards