fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n;
  5. printf("Enter the number: ");
  6. scanf("%d",&n);
  7.  
  8. int r=0;
  9. while(n>0){
  10. r=r*10;
  11. r=r+n%10;
  12.  
  13. n=n/10;
  14. }
  15. printf("The reverse is %d",r);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5312KB
stdin
2345
stdout
Enter the number: The reverse is 5432