C++ Saved Program: serene-life

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


#include<stdio.h>
#include<conio.h>
int reverse(int a)
{
 int b ,c,d=0,e,f,g,h=0;
 c=a;
 while(a>0)
 {
  a=a/10;
   d++;
   }
   a=c;
   while(a>0)
   {
   b=b%10;
   f=d;
   g=1;
   while(f>0)
   {
   g=g*10;
   f--;
   }
   h=h+b*g;
   d--;
   }
   return(h);
   }
   void main()
   {
    int x;
    scanf("%d",&x);
    printf("%d",reverse(x));
    }
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs