write program for palindrome
Answer Posted / md. irshad alam
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
void main()
{
clrscr();
int palind(char []);
int r;
char name[5];
cout<<"Enter a String...";
gets(name);
r=pal(name);
if(r==0)
{
cout<<"\n"<<"PALINDROME...";
}
else
{
cout<<"\n"<<"NOT A PALINDROME...";
}
getch();
}
int palind(char name[])
{
char *p,*t;
p=name;
t=name+strlen(name)-1;
while(*p)
{
if(*p != *t)
{
return(1);
}
p++;
t--;
}
return(0);
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What does ctime() do?
What are the uses of c++ in the real world?
What is runtime polymorphism in c++?
What kind of problems can be solved by a namespace?
What is the most common mistake on c++ and oo projects?
Is c better than c++?
Which is the best c++ software?
In the derived class, which data member of the base class are visible?
How does the copy constructor differ from the assignment operator (=)?
What's c++ used for?
What is the difference between mutex and binary semaphore?
How the virtual functions maintain the call up?
How to declaring variables in c++?
Is overriding possible in c++?
How many types of classes are there in c++?