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 the latest c++ version?
What are the steps in the development cycle?
What does it mean to declare a destructor as static?
What is the basic structure of c++ program?
What is a rooted hierarchy?
Explain the volatile and mutable keywords.
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
what are the iterator and generic algorithms.
Is python written in c or c++?
How are the features of c++ different from c?
What is meaning of in c++?
What is the use of default constructor?
What is a down cast?
What is encapsulation in c++ with example?
Explain differences between new() and delete()?