write program for palindrome

Answer Posted / prakash

#include<stdio.h>
#include<conio.h>

main()
{

char s1[10],s2[10];
int m,i,j;
scanf("%s",s1);
strcpy(s2,s1);
m=strlen(s1);
for(i=0,j=m-1;i<=m-1,j<=0;i++,j--)
{
if(s1[i]!=s2[j])
printf("STRING IS NOT PALINDROME ");
}
printf("STRING IS a PALINDROME ");
getch();
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by function overriding & function overloading in c++?

608


Explain what is class definition in c++ ?

608


Explain the purpose of the keyword volatile.

648


What is singleton class in c++?

602


Why do we need c++?

605






What does flush do?

568


If I is an integer variable, which is faster ++i or i++?

600


Is it possible for the objects to read and write themselves?

655


Write about the local class and mention its use?

621


What is searching?

670


What is a Default constructor?

936


How do I use turbo c++?

558


What are the various storage classes in C++?

657


Explain object slicing in c++?

591


What is a class template?

604