Friday 21 June 2013

C program to print reverse of a entered number

/* compiler- Turbo c++ author- Mangilal Sharma =================================*/ 
#include <conio.h>
#include <stdio.h>

void main()
{
 clrscr();
 int sum=0,num,a,n;
 printf("Enter No. in range of int (less than 32768): ");
 scanf("%d",&num);
 printf("Reverse of '%d' is: ",num);
 while(num>0)
 {
  a=num%10;
  sum=sum+a;
  printf("%d",a);
  num=num/10;
 }
 getch();
}
/*=============================19Nov.,2010=============================*/

1 comment:

You are welcome, your comment helps me to make this blog more better.