how to find out the reverse number of a digit if it is
input through the keyboard?
Answer Posted / sneha
main( )
{
int x,result,next;
printf("Enter The number to revers=");
scanf("%d",&x);
//5th
result=x%10;
result=result*10;
//4th
next=(x/10)%10;
result=(result+next)*10;
//3rd
next=(x/100)%10;
result=(result+next)*10;
//2nd
next=(x/1000)%10;
result=(result+next)*10;
//1st
next=(x/10000)%10;
result=result+next;
printf("%d",result);
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Why should I use standard library functions instead of writing my own?
What is nested structure with example?
What are near, far and huge pointers?
What do you know about the use of bit field?
Can we initialize extern variable in c?
What is dynamic dispatch in c++?
Why c language?
What is zero based addressing?
Is main a keyword in c?
What is a char c?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
Write a program to identify if a given binary tree is balanced or not.
Explain how can I right-justify a string?
Does free set pointer to null?
Why is sprintf unsafe?