WAP to read four digits number and display it in reverse order. Hints: For Example, if the input number is 123 the reverse no is 321

#include<stdio.h>
#include<conio.h>
void main(){
int n,r;
printf("Enter any number \n");
scanf("%d",&n);
while(n>0){
r=n%10;
printf("%d",r);
n=n/10;
}
getch();
}
Output:
Enter any number
234
432

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *