Friday, 26 June 2015



Aim - WAP To Reverse Four Digit Number

Code-



#include<stdio.h>

#include<conio.h>

void main ()

{

int num, a, b, c, num1;

clrscr ();

printf ("Enter The Four Digit Number : ");

scanf ("%d", &num);

a=num%10;

num=num/10;

b=num%10;

num=num/10;

c=num%10;

num=num/10;

num1=a*1000+b*100+c*10+num;

printf ("The Reversed Four Digit Number Is : %d", num1);

getch ();

}

OUTPUT

Enter The Four Digit Number : 1729

The Reversed Four Digit Number Is: 9271









No comments:

Post a Comment