Program: 60
If a five-digit number is input through the keyboard, write a program to reverse the number.| Let us C Solution
#include<stdio.h> int main() { int number=0, n; printf("Enter a number: "); scanf("%d", &n); while(n!=0) { number = number * 10; number = n % 10 + number; n = n/10; } printf("%d", number); return 0; }
Output
Enter a number: 12345 54321
Leave a Comment