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
Is empty stack c++?
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
What is switch case in c++ syntax?
Can we define a constructor as virtual in c++?
Define friend function.
What is format for defining a structure?
In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h
What is flush () in c++?
How do pointers work?
Why is it called c++?
Is recursion allowed in inline functions?
why and when we can declar member fuction as a private in the class?
What is implicit conversion/coercion in c++?
What is a static member?
How does list r; differs from list r();?