C Program which accepts a 4-digit number from the user and display it in reverse order - Wit Output

#include<stdio.h>
#include<conio.h>

void main()
{
int a,b,c,d,e,f;
printf(“Enter 4-Digit Number  : ”);
scanf(“%d”,&a);
b=a%10;
c=b%10;
d=c%10;
e=d%10;
f=b*1000+c*100+d*10+e;
printf(“%d”,f);

getch();

}

OUTPUT:

Enter 4-Digit Number : 1234
4321
Share on Google Plus

About Akash Manhas

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment