P
Profetas
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
void reverse(char *str);
int main(void)
{
char *string;
printf( "Enter a line of text:\n" );
scanf("%s", &string);
printf( "The string printed backwards is: " );
reverse(&string);
puts("\0");
exit(EXIT_SUCCESS);
}
void reverse(char *str)
{
if( str[0]=='\0')
{
return;
}
else
{
reverse(&str[1]);
putchar(str[0]);
}
}
#include <stdio.h>
#include <stdlib.h>
void reverse(char *str);
int main(void)
{
char *string;
printf( "Enter a line of text:\n" );
scanf("%s", &string);
printf( "The string printed backwards is: " );
reverse(&string);
puts("\0");
exit(EXIT_SUCCESS);
}
void reverse(char *str)
{
if( str[0]=='\0')
{
return;
}
else
{
reverse(&str[1]);
putchar(str[0]);
}
}