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
Is c++ the hardest language?
what is data abstraction in C++?
How is modularity introduced in C++?
What is c++ stringstream?
Which one is better- macro or function?
What does h mean in maths?
Explain rethrowing exceptions with an example?
What is a pdb file?
What are c++ tokens?
What is a linked list in c++?
Can you declare an array without a size in c++?
Name the operators that cannot be overloaded in C++?
How do you establish a has-a relationship?
What is algorithm in c++ programming?
Can we overload operator in c++?