Reverse Number Logic in C program

Reverse Number Logic in C program

This is program for reversing digit of given number by simple logic. Program use While loop for repetitive process.

/* Program For Reverse a Number*/
#include<stdio.h>
#include<math.h>

int main()
{
int no,rem;
printf("nEnter non");
scanf("%d",&no);
int bs=no;
int sum=0;
while(no)
{
rem=no%10;
sum=sum*10+rem;
no=no/10;
}

printf("Reverse Of %d is t :%dn",bs,sum);
return 0;


}