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
What is the role of C++ shorthand's?
Why would you use pointers in c++?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?
What is the keyword auto for?
Will this c++ program execute or not?
Can you Mention some Application of C/C++?
Why main function is special in c++?
Define a constructor - what it is and how it might be called (2 methods)?
Explain rethrowing exceptions with an example?
How do you decide which integer type to use?
What is difference between c++ 11 and c++ 14?
Write some differences between an external iterator and an internal iterator?
Differentiate between a constructor and a destructor in c++.
what is a class? Explain with an example.
What is the difference between a definition and a declaration?