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 is the extraction operator and what does it do?
Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?
How can we access protected and private members of a class?
What is command line arguments in C++? What are its uses? Where we have to use this?
Will this c++ program execute or not?
What are the important differences between c++ and java?
What are punctuators in c++?
Using a smart pointer can we iterate through a container?
How many keywords are used in c++?
What are the different types of comments allowed in c++?
When should we use multiple inheritance?
Explain function overloading and operator overloading.
Explain stack unwinding.
How do we implement inheritance in c++?
What does n mean in c++?