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
What is vector string in c++?
Why do we need templates?
How do you differentiate between overloading the prefix and postfix increments?
Should I learn c or c++ or c#?
Write about an iterator class?
What is function declaration in c++ with example?
Explain the use of this pointer?
What are the advantages of c++ over c?
What is ofstream c++?
What is an overflow error?
what is oops and list its features in c++?
If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?
How does c++ structure differ from c++ class?
Why is standard template library used?
How do you establish an is-a relationship?