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 do you mean by storage classes?
Can we use this pointer in a class specific, operator-overloading function for new operator?
What are the advantages of c++ over c?
Tell me what are static member functions?
What do nonglobal variables default to a) auto b) register c) static
How can you specify a class in C++?
Write about a nested class and mention its use?
What is rtti in c++?
Can union be self referenced?
What are the differences between java and c++?
Does c++ vector allocate memory?
What are the advantages of using typedef in a program?
Is c++ slower than c?
What is diamond problem in c++?
What is stack unwinding?