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 / ankush kumar mittal

#include<stdio.h>
void main()
{
int rev=0,a,b,c;
scanf("%d",a);
if(a=!0)
{
b=a%10;
a=a/10;
rev=rev*10+b;
}
}

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens if you free a pointer twice?

594


plz let me know how to become a telecom protocol tester. thank you.

1736


What is wrong with this statement? Myname = 'robin';

806


What is realloc in c?

571


Describe newline escape sequence with a sample program?

635






What are the complete rules for header file searching?

657


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

641


How do you do dynamic memory allocation in C applications?

619


Explain what are the different data types in c?

743


What is wrong with this program statement?

600


What are static variables in c?

612


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

1770


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

798


Explain the advantages and disadvantages of macros.

612


how to execute a program using if else condition and the output should enter number and the number is odd only...

1643