write program for palindrome
Answer Posted / anonymous
#include<stdio.h>
#include<stdlib.h>
main()
{
int i,j,len=0;
char name[25];
printf("Enter the string");
scanf("%s",&name);
while(name[len]!='\0')
len++;
printf("\n%d",len);
for(i=0,j=len-1;i<len/2;i++,j--)
{
if(name[i]!=name[j])
{
printf("The string is not a palindrome");
exit(0);
}
}
else
{
printf("The string is a palindrome");
}
}
}
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a c++ map?
Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
What is the difference between multiple and multilevel inheritance in c++?
Can union be self referenced?
How to get the current position of the file pointer?
How the keyword struct is different from the keyword class in c++?
Is overriding possible in c++?
What is the difference between new() and malloc()?
Explain function overloading and operator overloading.
Why do we use classes in c++?
What is the difference between #import and #include in c++?
How is computer programming useful in real life?
What is an html tag?
How are the features of c++ different from c?
Explain the uses oof nested class?