how to find out the reverse number of a digit if it is
input through the keyboard?
Answer Posted / sreejesh1987
int rev(int,int);
void main()
{
int a,b;
clrscr();
printf("\nEnter the number to reverse:");//456
scanf("%d",&a);
b=a%10;//b=6
printf("\nReverse of the number is: %d",rev(a,b));
getch();
}
int rev(int a,int b)
{
if(a>9)//456
{
a=a/10;//a=45
b=b*10+a%10;//65
return rev(a,b);
}
else
return b;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is signed and unsigned?
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if
Explain the properties of union.
What is difference between %d and %i in c?
Compare interpreters and compilers.
What is the difference between NULL and NUL?
Explain setjmp()?
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
What does p mean in physics?
What is the difference between Printf(..) and sprint(...) ?
What are the three constants used in c?
What is preprocessor with example?
What is calloc in c?
Explain how can you determine the size of an allocated portion of memory?
How do I get an accurate error status return from system on ms-dos?