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
What is the benefit of c++?
Differentiate between realloc() and free().
What are the storage qualifiers?
what are the iterator and generic algorithms.
Can we use this pointer in a class specific, operator-overloading function for new operator?
Write bites in Turbo c++ Header ("Include") Files.
Should I learn c or c++ first?
Where can I run c++ program?
What are the important differences between c++ and java?
What is the difference between reference and pointer?
What are namespaces in c++?
What are the various storage classes in C++?
why and when we can declar member fuction as a private in the class?
What is the difference between delegation and implemented-in-terms-of?
What are register variables?