write program for palindrome
Answer Posted / aravindhan.d
// r=reminder,s=sum,n=number.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,m,r,s=0;
clrscr();
printf("Enter the n value:");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(m==s)//THIS SAME CODE IS GIVEN ABOVE BUT ONE CHANGE NOT m==n THAT IS m==s
{
printf("NUMBER IS PALINDROME");
}
else
{
printf("NUMBER IS NOT PALINDROME");
}
| Is This Answer Correct ? | 19 Yes | 9 No |
Post New Answer View All Answers
What is the use of seekg in c++?
How is computer programming useful in real life?
Define virtual constructor.
What is this pointer in c++?
What is a buffer c++?
Explain the volatile and mutable keywords.
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
What does std :: flush do?
What character terminates all character array strings a) b) . c) END
What are member functions used in c++?
Mention the ways in which parameterized can be invoked.
Explain the problem with overriding functions
Write about a nested class and mention its use?
Write an algorithm that determines whether or not an almost complete binary tree is a heap.
What is the basic of c++?