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 would you use the functions sin(), pow(), sqrt()?
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
Can comments be nested?
Define pre-condition and post-condition to a member function in c++?
What is linked list in c++?
What are member functions used in c++?
Difference between an inspector and a mutator
Explain about Garbage Collector?
What is iterator c++?
What is virtual function? Explain with an example
What are the general quetions are in DEna bank manager IT/System interviews?
When must you use a pointer rather than a reference?
What is implicit pointer in c++?
What is operator overloading in c++ example?
Can you write a function similar to printf()?