write program for palindrome

Answer Posted / nithya

#include<stdio.h>
#include<string.h>
main()
{
char str1[35];
char str2[35];
clrscr();
printf("Enter the string of words to check for
Palindrome or Not");
scanf("%s",&str1);
strcpy(str2,str1);
strrev(str2);
if(strcmp(str1,str2)==0)
printf("The entered string of words %s are
palindrome",str1);
else
printf("The entered string of words %s are not
palindrome",str1);
getch();
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Distinguish between new and malloc and delete and free().

586


What is the meaning of string in c++?

583


What kind of jobs can I get with c++?

611


Give 10 points of differences between C & C++.

640


How does c++ sort work?

575






Explain how to initialize a const data member.

610


What do you mean by storage classes?

813


Which one is a preferred language C or C++? Why?

629


Is c++ free?

597


What is srand c++?

593


Comment on local and global scope of a variable.

593


Can c++ do everything c can?

613


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

1524


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

1467


Explain the uses oof nested class?

633