write program for palindrome

Answer Posted / easwar

#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m,r;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(s == m) // This is important step
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    172 Yes 77 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is basic if statement syntax?

563


What is & in c++ function?

592


Why is c++ considered difficult?

645


What is c++ good for?

589


What are the defining traits of an object-oriented language?

694






what are the iterator and generic algorithms.

1483


Do the names of parameters have to agree in the prototype, definition, and call to the function?

599


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

4853


How many types of scopes are there in c++?

578


What are the storage qualifiers?

662


Why c++ is so important?

605


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

800


How do you declare A pointer to a function which receives nothing and returns nothing

719


Describe delete operator?

621


Can you overload the operator+ for short integers?

596