write program for palindrome
Answer Posted / faiz misbah
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i,j,f=0;
char a[10];
clrscr (); // only works on windows
gets(a);
for (i=0;a[i]!='\0';i++)
{
}
i--;
for (j=0;a[j]!='\0';j++,i--)
{
if (a[i]!=a[j])
{
printf("string is not palindrome");
return(0);
}
}
printf("string is palindrome");
return(0);
}
| Is This Answer Correct ? | 91 Yes | 84 No |
Post New Answer View All Answers
Is it possible to provide special behavior for one instance of a template but not for other instances?
Tell me can a pure virtual function have an implementation?
How to declaring variables in c++?
What are member functions used in c++?
What is exception handling? Does c++ support exception handling?
Show the declaration for a pointer to function returning long and taking an integer parameter.
Write about the various sections of the executable image?
What do manipulators do?
What is the two main roles of operating system?
What does it mean to declare a member variable as static?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
What is the best ide for c++?
what is data encapsulation in C++?
What is singleton pattern in c++?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?