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


Please Help Members By Posting Answers For Below Questions

What is the role of C++ shorthand's?

689


Why would you use pointers in c++?

641


. 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?

2775


What is the keyword auto for?

584


Will this c++ program execute or not?

620






Can you Mention some Application of C/C++?

635


Why main function is special in c++?

677


Define a constructor - what it is and how it might be called (2 methods)?

618


Explain rethrowing exceptions with an example?

616


How do you decide which integer type to use?

588


What is difference between c++ 11 and c++ 14?

586


Write some differences between an external iterator and an internal iterator?

599


Differentiate between a constructor and a destructor in c++.

577


what is a class? Explain with an example.

630


What is the difference between a definition and a declaration?

585