Answers for "Verify that the word is read from the left and right"

C
0

Verify that the word is read from the left and right

#include <stdio.h>
#include<string.h>
int main(void) {
int n,m,j;
char i,t[n],d[n];
printf("enter the first word :");
gets(t);
n=strlen(t);
printf("Opposite word is :");
for(j=n-1;j>=0;j--){
printf("%c",t[j]);
}
m=0;
for(j=n-1;j>=0;j--){
  for(i=0;i<n;i++){
d[j]=t[j];
if(d[j]==t[i]){
  m++;
}
else {
  m=0;
}
  }
}
printf( "\nThe word is %s",(m==1)?"read from the left and right.":"not read from the left and right.");
return 0;
}
Posted by: Guest on July-17-2021

Code answers related to "Verify that the word is read from the left and right"

Code answers related to "C"

Browse Popular Code Answers by Language