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
What are literals in C++?
What is the difference between a definition and a declaration?
What is a terminating character in c++?
What's the order in which the objects in an array are destructed?
Explain deep copy?
What is &x in c++?
How can virtual functions in c++ be implemented?
Why is standard template library used?
What is meant by iomanip in c++?
Explain the uses of static class data?
can any one help to find a specific string between html tags
which is changed to a sting..
weather.html looks (for location) is
Can we define function inside main in c++? When one must use recursion function? Mention what happens when recursion functions are declared inline? Why the usage of pointers in C++ is not recommended ? Explain the difference between using macro and inline functions?