How can i print name which the user enter and reverse the string in C? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 23

How can i print name which the user enter and reverse the string in C?

5th Apr 2018, 2:20 PM
Creative Coder
Creative Coder - avatar
2 Réponses
+ 15
#include <stdio.h> #include <string.h>   int main() { char arr[100];   printf("Enter a string to reverse\n"); gets(arr);   strrev(arr);   printf("Reverse of the string is \n%s\n", arr);   return 0; }
5th Apr 2018, 2:23 PM
Wally
Wally - avatar
+ 1
you can also use loops
1st Jul 2018, 2:40 AM
Swapnil Patel
Swapnil Patel - avatar