Its output is always "not palindrome".Code:#include <stdio.h> #include <string.h> #include <conio.h> int main() { char x[26]; char y[26]; clrscr(); printf("Enter String: \n"); fgets( x, 26, stdin); strcpy( y, x); strrev( y ); if (strcmp( y, x) == 0) printf("%s is palindrome", x); else printf("%s is not palindrome", x); getch(); return 0; }
It works on gets() but I want to use fgets() instead.
Help please. Anyone?