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 is abstraction c++?
Is the declaration of a class its interface or its implementation?
What is a static element?
What is the use of vtable?
What apps are written in c++?
In a function declaration, what does extern mean?
What is implicit conversion/coercion in c++?
Keyword mean in declaration?
Why do we use vector in c++?
Explain terminate() function?
How can you link a c++ program to c functions?
Explain the use of virtual destructor?
What kind of jobs can I get with c++?
What is the output of the following program? Why?
How many keywords are used in c++?