request user input, and then print the string backwards
#include
#include
#include
int main(void)
{
char *j;
register int i;
j = malloc(80);
if(!j) {
printf("Memory request failed.\n");
exit(1);
}
gets(j);
for(i = strlen(j) - 1; i >= 0; i--)
putchar(j[ i ]);
free(j);
return 0;
}