write program for palindrome
Answer Posted / deepa garia
#include<stdio.h>
#include<conio.h>
int main()
{
int r,n,k=0,l;
printf("\nENTER THE NUMBER ");
scanf("%d",&n);
l=n;
while(n>0)
{
r=n%10;
n=n/10;
k=k*10+r;
printf("%d",r);
}
if(k==l)
printf("\npalindrome");
else
printf("\n not palindrome");
getch();
return 0;
}
| Is This Answer Correct ? | 16 Yes | 13 No |
Post New Answer View All Answers
What is the type of this pointer in c++?
What are advantages of using friend classes?
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?
Write a program to add three numbers in C++ utilizing classes.
How can a struct in c++ differs from a struct in c?
What problems might the following macro bring to the application?
Why do we need constructors in c++?
Write a program which uses Command Line Arguments
What is the operator in c++?
What is a wchar_t in c++?
How can you specify a class in C++?
What is the use of bit fields in structure declaration?
State the difference between pre and post increment/decrement operations.
What is stoi in c++?
What are different types of loops in c++?