Find the reverse of a string with C.
#include <stdio.h>
#include <string.h>
int main()
{
char str[100];
/* Input string from user */
printf("Enter any string: ");
gets(str);
printf("Original string = %s\n", str);
strrev(str);
printf("Reverse string = %s", str);
return 0;
}
Output
Enter any string : Rezaul Karim
Total number of words = 2
0 Comments