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 doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
What are friend classes? What are advantages of using friend classes?
What is helper in c++?
what are the characteristics of Class Members in C++?
Write about all the implicit member functions of a class?
What is wrapper class in c++?
What is this weird colon-member (" : ") syntax in the constructor?
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
What is a static element?
What is the best ide for c++?
Describe the process of creation and destruction of a derived class object?
How are pointers type-cast?
What is the main purpose of c++?
Why do we use vector in c++?
Is c better than c++?