Write a program  that allows you to reverse the digits of an integer N entered by the user.   for example  N = 35672  the result is   27653 


******** In Algorithm ********

Algorithm Variables N, r : integers Begin r ← 0 write("Enter an integer :") read(N) while ( N > 0 ) r ← r*10 r ← r + N % 10 N ← N / 10 next write(r) End


Result ==> Enter an integer : 597012 210795


******** In C ********

#include<stdio.h> int main() { int n,r=0; printf("Enter an integer : "); scanf("%d",&n); while(n>0){ r = r * 10 ; r = r + n%10 ; n= n/10; } printf("%d",r); return 0; }


******** In C++ ********

#include <iostream> using namespace std; int main() { int n,r=0; cout<<" Enter an integer : "; cin>>n; while(n>0){ r = r * 10 ; r = r + n%10 ; n= n/10; } cout<<r; return 0; }