Program to reverse a number – Basic C++ Programming Tutorials

Program to reverse a number in C++


#include <stdio.h>
#include <conio.h>
void main()

int n, rev=0, rem;
printf(“Enter number:”);
scanf(“%d”, &n);
while(n != 0)
      rem = n%10;
      rev = rev*10 + rem;
n /= 10;
printf(“Reversed number: %d”, rev);

“My posts/articles/images are not allowed to be stolen/copied anywhere at Cyber space. Doing so will allow me to take a legal action against the copier.”

Related Posts

Leave a Comment

Kindly solve the following puzzle to prove that you\'re not a bot: