write program for palindrome
Answer Posted / mojib khan
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char str1[30],str2[30];
int l;
clrscr();
printf("Enter the string \t");
gets(str1);
strrev(str1);//for reverse string
strcpy(str1,str2);//copy str1 to str2
l=strcmp(str2,str1); //comparing strings it will return 0/1
if(l==0)
{
printf("\nString is Palindrom");
}
else
printf("String is not palindrom");
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Define private, protected and public access control.
How do you show the declaration of a virtual constructor?
What is a manipulative person?
What is the use of this pointer in c++?
What are activex and ole?
Does c++ support multilevel and multiple inheritances?
How can a called function determine the number of arguments that have been passed to it?
Can a built-in function be recursive?
Is c++ used anymore?
What is the best c++ ide?
Can you please explain the difference between using macro and inline functions?
Can you sort a set c++?
Difference between overloaded functions and overridden functions
Can we use struct in c++?
Can we change the basic meaning of an operator in c++?