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
How is modularity introduced in C++?
What is the difference between #define debug 0 and #undef debug?
What is the importance of mutable keyword?
Define anonymous class.
How do I download c++?
What is decltype c++?
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
What is public, protected, private in c++?
What are the new features that iso/ansi c++ has added to original c++ specifications?
What is the identity function in c++? How is it useful?
Why can templates only be implemented in the header file?
What are maps in c++?
what is oops and list its features in c++?
What is #include math h in c++?
write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num