write program for palindrome

Answer Posted / ram thilak.p

#include<stdio.h>
#include<conio.h>
#include<string.h>

void main()
{
char a[20];
int c;
printf("\n\n\t Enter A String:");
scanf("%s",a);
c=strcmpi(strrev(a),a);
if(c==0)
{printf("\n %s is a Palindrome",a);}
else
{printf("\n %s is not a Palindrome",a);)
getch();
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is function prototyping? What are its advantages?

583


What are dynamic type checking?

606


What do you understand by a pure virtual member function?

538


Implement stack operations with pointers with appropriate exception checks.

560


what is COPY CONSTRUCTOR and what is it used for?

613






Which is better c++ or java?

556


how can i access a direct (absolute, not the offset) memory address? here is what i tried: wrote a program that ask's for an address from the user, creates a FAR pointer to that adress and shows it. then the user can increment/decrement the value in that address by pressing p(inc+) and m(dec-). NOW, i compiled that program and opened it twice (in 2 different windows) and gave twice the same address to it. now look what happen - if i change the value in one "window" of the program, it DOES NOT change in the other! even if they point to the same address in the memory! here is the code snippet: //------------------------------------------------------ #include //INCLUDE EVERY KNOWN HEADER FILE #include //FOR ANY CASE... #include #include #include main() { int far *ptr; //FAR POINTER!!! long address; char key=0; //A KEY FROM THE KEYBOARD int temp=0; clrscr(); cout<<"Enter Address:"; cin>>hex>>address; //GETS THE ADDRESS clrscr(); (long)ptr=address; temp=*ptr; //PUTS THE ADDRESS IN THE PTR cout<<"["<

1808


What is operators in c++?

561


write a program that reads in a file and counts the number of lines, words, and characters. Your program should ask the user to input a filename. Open the file and report an error if the file does not exist or cannot be opened for some other reason. Then read in the contents of the file and count the number of lines, words, and characters in the file. Also print additional information about the file, such as the longest and shortest words, and longest and shortest lines. For simplicity, we define a word to be one or more characters ending with white space (a space, tab, carriage return, etc.). Functions for checking the types of characters can be found in the ctype.h header file, so you want to include this header file in your program. For example, the sentence below could be all that is in a file. This sentence IT 104 is taught in C++. has 32 characters, one line, and six words. The shortest line is 32 characters. The longest line is 32 characters. The shortest word is 2 characters. The longest word is 6 characters

4841


How do you decide which integer type to use?

572


How do I make turbo c++ full screen?

579


What do nonglobal variables default to a) auto b) register c) static

637


What are keywords in c++?

592


Is c++ used anymore?

578


What are the c++ access specifiers?

762