This code should be in C eclipse if possible It should also
Solution
#include <stdio.h>
#include<stdlib.h>
#include<time.h>
#include <string.h>
void reverse(char s[]) {
int c, i , j;
for (i = 0, j = strlen(s)-1; i < j; i++, j--) {
c = s[i];
s[i] = s[j];
s[j] = c;
}
return;
}
void removespaces(char s[]) {
int i,count = 0;
// Traverse the given string. If current character
// is not space, then place it at index \'count++\'
for (i = 0; s[i]; i++)
if (s[i] != \' \')
s[count++] = s[i]; // here count is
// incremented
s[count] = \'\\0\';
return;
}
int main() {
char a[200];
char b[200],c[200],d[200];
printf(\"Enter a string to check :\");
fgets(a, sizeof a, stdin);
delay(5000);
strcpy(c,a);
strcpy(d,a);
reverse(d);
removespaces(a);
strcpy(b,a);
reverse(a);
printf(\"Your Input : %s\ \",a);
printf(\"Reverse Input : %s\ \",b);
if(strcmp(a, b) == 0) {
printf(\"Congratulations! Palindrome found\ \");
} else {
printf(\"The string is not a Palindrome\ \");
}
return 0;
}

