Print all the palindrome numbers.If a number is not
palindrome make it one by attaching the reverse to it.
eg:123
output:123321 (or) 12321
Answer Posted / vikas shukla
# include<stdio.h>
int main()
{
int n,n1,rem,rev=0;
printf("enter the number\n");
scanf("%d",&n);
n1=n;
while(n>0)
{
rem=n%10;
rev=rev*10+rem;
n=n/10;
}
if(n1==rev)
{
prinntf("the given no is palindrome");
}
else
{
printf("no is not palindrome");
}return 0;
}
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
Why is #define used?
Can static variables be declared in a header file?
Are the variables argc and argv are local to main?
What does s c mean on snapchat?
Write a program to print factorial of given number using recursion?
What is your stream meaning?
Explain what does it mean when a pointer is used in an if statement?
Explain how can I pad a string to a known length?
Is c dynamically typed?
Who is the main contributor in designing the c language after dennis ritchie?
Why array is used in c?
Differentiate between a structure and a union.
Differentiate call by value and call by reference?