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
Does c++ support multilevel and multiple inheritances?
what is the difference between overloading & overriding? give example.
What is the use of string in c++?
what is a class? Explain with an example.
Explain the concept of dynamic allocation of memory?
Explain the isa and hasa class relationships. How would you implement each?
What are signs of manipulation?
What are static and dynamic type checking?
What does std :: flush do?
the first character in the variable name must be an a) special symbol b) number c) alphabet
What is a singleton class c++?
What is the difference between set and map in c++?
Is it possible for the objects to read and write themselves?
Can we run c program in turbo c++?
Explain the problem with overriding functions