write program for palindrome
Answer Posted / mohammed arif khan
//MOHAMMED ARIF KHAN
// PROGRAM OF PALIDROM
#include<stdio.h>
#include<conio.h>
void main()
{
char str[20],*ptr,*ptr1;
int c=0;
clrscr();
printf("Enter the string:");
scanf("%s",&str);
for(ptr1=str;*ptr1!='\0';ptr1++);
ptr1--;
for(ptr=str;*ptr!='\0';ptr++,ptr1--)
{
if(*ptr!=*ptr1)
{
c=1;
break;
}
}
if(c==0)
{
printf("\n palindrome");
}
else
{
printf("\n not palindrome");
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I download c++?
What are the advantages of using typedef in a program?
What is pair in c++?
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
What is a memory leak c++?
What is the arrow operator in c++?
What is overloading unary operator?
What is the use of ::(scope resolution operator)?
List the issue that the auto_ptr object handles?
What is the difference between ++ count and count ++?
What is copy constructor? Can we make copy constructor private in c++?
What are the two types of polymorphism?
Can we use pointers in c++?
What's the hardest coding language?
Where are setjmp and longjmp used in c++?