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
When is the “void” keyword used in a function?
define string ?
hi send me sample aptitude papers of cts?
Which is best book for data structures in c?
What does typeof return in c?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
What is a stream?
What are the functions to open and close the file in c language?
Is main is a keyword in c?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
Tell me the use of bit field in c language?
When should the const modifier be used?
What does sizeof return c?
Can a pointer be volatile in c?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?