Write a program in pascal: Given a natural number n. Replace the order of the digits of the number n with the opposite.

program reverse1;
var s, m, n: integer;

begin
writeln (‘Enter a number’);
readln (n);
s: = 0;
while n> 0 do
begin
// Find the remainder of dividing the number by 10
// (the loop gets numbers in reverse order).
m: = n mod 10;
// Remnants are added to the end of the new number.
// When the loop repeats, the corresponding numbers move
// to the next bit by multiplying by 10.
s: = s * 10 + m;
n: = n div 10
// The number is divided by 10 so that on the next pass
// find the remainder of the cycle – the most significant digit.
end;
writeln (s)
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.