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
How do you define/declare constants in c++?
How did c++ get its name?
What is virtual methods?
Do you need a main function in c++?
Is it possible to get the source code back from binary file?
How do you sort a sort function in c++ to sort in descending order?
What is DlgProc?
What is the basic structure of c++ program?
Who created c++?
How will you call C functions from C ++ and vice-versa?
What is function overriding in c++?
How would you use the functions sin(), pow(), sqrt()?
Describe public access specifiers?
What are the methods of exporting a function from a dll?
What happens if a pointer is deleted twice?