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
What is the difference between functions getch() and getche()?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is 2 d array in c?
Which is best book for data structures in c?
Explain about block scope in c?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
Write a program to print fibonacci series without using recursion?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What is #include stdlib h?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What functions are in conio h?
What are global variables and explain how do you declare them?
Why c is called a middle level language?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
what is ur strangth & weekness