REVERSEING A NUMBER

REVERSEING A NUMBER
#include
#include
#include
void main()
{
char word[50],rev[50],stack[50];
gets(word);
int i,l=strlen(word),top=-1;
for(i=0;i{
stack[++top]=word[i];
}
i=0;
while(top>=0)
{
rev[i++]=stack[top--];
}
puts(rev);
}

Post a Comment

0 Comments