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
What is basic if statement syntax?
What is & in c++ function?
Why is c++ considered difficult?
What is c++ good for?
What are the defining traits of an object-oriented language?
what are the iterator and generic algorithms.
Do the names of parameters have to agree in the prototype, definition, and call to the function?
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
How many types of scopes are there in c++?
What are the storage qualifiers?
Why c++ is so important?
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c
How do you declare A pointer to a function which receives nothing and returns nothing
Describe delete operator?
Can you overload the operator+ for short integers?