C Program to reverse the given number Posted by Shrinidhi Katti Get link Facebook X Pinterest Email Other Apps #include<stdio.h> int main() { int n; printf("Enter a number\n"); scanf("%d",&n); int reversed_number=0,rem; while(n!=0) { rem=n%10; reversed_number=reversed_number*10+rem; n=n/10; } printf("The reversed number is:%d",reversed_number); } Output: Comments
Comments
Post a Comment