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
You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()
what is the difference between overloading & overriding? give example.
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?
What is vector pair in c++?
what are Access specifiers in C++ class? What are the types?
What are the important differences between c++ and java?
In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....
What is algorithm in c++ programming?
How do I run c++?
What is const pointer and const reference?
Why do we use double in c++?
What is jump statement in C++?
Do you know about C++ 11 standard?
What is oop in c++?
what is Loop function? What are different types of Loops?