Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
#include <stdio.h>
#include <string.h>
void main()
{
char string[25], revString[25]={'\0'};
int i,length = 0, flag = 0;
clrscr();
fflush(stdin);
printf("Enter a string\n");
gets(string);
if (flag == 1)
printf ("%s is a palindrome\n", string);
else
printf("%s is not a palindrome\n", string);
}
/*----------------------------------------------------
Output
Enter a string
madam
The length of the string 'madam' = 5
madam is a palindrome
RUN2
Enter a string
good
The length of the string 'good' = 4
good is not a palindrome
----------------------------------------------------------*/