write program for palindrome
Answer Posted / mojib khan
#include<stdio.h>
void main()
{
int i=0,l,flag=0;
char str[30];
clrscr();
printf("Enter the string\n");
gets(str);
l=strlen(str)-1;
while(i<=l)
{
if(str[i]==str[l])
flag=1;
else
{
flag=0;
break;
}
i++;
l--;
}
if(flag==1)
printf("String is palindrom");
else
printf("\n String is not palindrom");
getch();
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What are the characteristics of friend functions?
Differentiate between a copy constructor and an overloaded assignment operator.
What is flush () in c++?
What is a float in c++?
Differentiate between declaration and definition.
What is time_t c++?
What is class definition in c++ ?
Which function should be used to free the memory allocated by calloc()?
What is the prototype of printf function?
Difference between overloading vs. Overriding
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
What are vtable and vptr?
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
State two differences between C and C++.
what is oops and list its features in c++?