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 difference between strcpy() and strncpy()?
Why c++ is created?
Is java made in c++?
What is called array?
How is data hiding achieved in c++?
What is the difference between the compiler and the preprocessor?
What are iterators in c++?
Write an algorithm that determines whether or not an almost complete binary tree is a heap.
What is scope in c++ with example?
How do you establish a has-a relationship?
Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened
Which should be more useful: the protected and public virtuals?
Does c++ have foreach?
How to get the current position of the file pointer?
Is swift faster than go?