Question:Write a c program to reverse a given number 

Answer 
#include<stdio.h>
int main(){
    int num,r,reverse=0;

    printf("Enter any number: ");
    scanf("%d",&num);

    while(num){
         r=num%10;
         reverse=reverse*10+r;
         num=num/10;
    }

    printf("Reversed of number: %d",reverse);
    return 0;
}
Sample output: Enter any number: 12 Reversed of number: 21 

+ ExplanationNot Moderated
+ Report
Total Preview: 797
Write a c program to reverse a given number
Copyright © 2024. Powered by Intellect Software Ltd