write program for palindrome
Answer Posted / ashok
#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 ? | 0 Yes | 1 No |
Post New Answer View All Answers
You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()
What's the most powerful programming language?
What is a stack c++?
C is to C++ as 1 is to a) What the heck b) 2 c) 10
Why c++ is better than c language?
Explain how overloading takes place in c++?
What is an associative container in c++?
Write a short code using c++ to print out all odd number from 1 to 100 using a for loop
Why null pointer is used?
What is the purpose of ios::basefield in the following statement?
What are shallow and deep copy?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
What are the three forms of cin.get() and what are their differences?
Can I make ios apps with c++?
Which c++ compiler is best?