write program for palindrome

Answer Posted / md. arif shahmim

#include<stdio.h>
#include<string.h>
#define size 26

void main()
{
char strsrc[size];
char strtmp[size];

clrscr();
printf("\n Enter String:= "); gets(strsrc);

strcpy(strtmp,strsrc);
strrev(strtmp);

if(strcmp(strsrc,strtmp)==0)
printf("\n Entered string \"%s\" ispalindrome",strsrc);
else
printf("\n Entered string \"%s\" is not
palindrome",strsrc);
getch();
}

Is This Answer Correct ?    16 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define token in c++.

710


What is endl c++?

600


What is object file? How can you access object file?

593


How do pointers work?

701


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

1499






What is a c++ map?

657


What is virtual destructor? What is its use?

571


Why is polymorphism useful?

561


I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.

2278


What is a constant? Explain with an example.

552


Can we use this pointer in a class specific, operator-overloading function for new operator?

609


What are the c++ access specifiers?

765


When does the c++ compiler create temporary variables?

562


Explain the concept of dynamic allocation of memory?

617


What are proxy objects in c++?

636