What is the problem on this code i want print reverse string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is the problem on this code i want print reverse string

/* C program to Reverse a String without using strrev() */ #include <stdio.h> #include <string.h> int main() {    char Str[100];    int i, len;    printf("\n Please Enter any String :  ");    gets(Str);       len = strlen(Str);    printf("\n String after Reversing : ");    for (i = len - 1; i >= 0; i--)    {    printf("%c", Str[i]);    }      return 0; }

15th Jul 2018, 7:26 PM
Manoj Shelgoankar
Manoj Shelgoankar - avatar
5 Answers
+ 1
Your code is working perfectly in my machine. Avoid the warning of the compiler and go ahead run your program ,, u will get the desired output.
15th Jul 2018, 8:39 PM
‏‪‏‪PRAKASH YADAV‬‏‬‏
‏‪‏‪PRAKASH YADAV‬‏‬‏ - avatar
+ 1
your code is working perfectly in sololearn code playground. Don't write your code in a clumsy way. Write both header files in different lines and run the program ,,it will work.
15th Jul 2018, 8:48 PM
‏‪‏‪PRAKASH YADAV‬‏‬‏
‏‪‏‪PRAKASH YADAV‬‏‬‏ - avatar
+ 1
k thanks
15th Jul 2018, 8:49 PM
Manoj Shelgoankar
Manoj Shelgoankar - avatar
0
k thanks bro but this code not working in sololearn code playground
15th Jul 2018, 8:41 PM
Manoj Shelgoankar
Manoj Shelgoankar - avatar
0
Thanks
5th Dec 2018, 12:47 AM
Sir Jerome
Sir Jerome - avatar