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
How would perform Pattern Matching in C++?
What is a storage class?
Declare a class vehicle and make it an abstract data type.
What is ostream in c++?
Which one is a preferred language C or C++? Why?
How does com provide language transparency?
What is the benefit of c++?
What are stacks? Give an example where they are useful.
What are iterators in c++?
How do you declare a set in c++?
How would you use the functions randomize() and random()?
Is there any function that can skip certain number of characters present in the input stream?
What are the storage qualifiers?
How can you differentiate between inheritance and implementation in c++?
Why do we use iterators?