0

C program to check palindrome.

C programming

#include<stdio.h>#include<conio.h>void main(){char str[10];int len,flag,i,j;clrscr();printf(“Enter a string:”);scanf(“%s”,str);len=strlen(str);for(i=0,j=len;i<=len,j>=0;i++,j–){if(str[i]==str[j])flag=1;else{flag=0; break; }}if(flag==1)printf(“PALINDROME!!”);elseprintf(“NOT A PALINDROME!!”);getch();} So lets have an explanation of the code. first of all what is palindrome palindrome is a string that remain same when reversed. so here in the program we are… Continue Reading