I am looking for the C
program for reverse the digits like below:
If i enter:
123456
Then the result would
Here is a simple solution to this complex problem:
#include
int main()
{
int ch;
ch = getchar();
if (ch != '\n') {
main();
printf("%c", ch);
}
}
#include
#include
static void newline(void)
{
printf("\n");
}
int main()
{
int ch;
ch = getchar();
if (ch != '\n') {
main();
printf("%c", ch);
} else {
atexit(newline);
}
}