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
write a programming in c to find the sum of all elements in an array through function.
How is a macro different from a function?
How does pointer work in c?
What is declaration and definition in c?
Distinguish between actual and formal arguments.
How to establish connection with oracle database software from c language?
int far *near * p; means
When should you not use a type cast?
can any one tel me wt is the question pattern for NIC exam
How can I implement a delay, or time a users response, with sub-second resolution?
Which is an example of a structural homology?
What are types of preprocessor in c?
Explain what are header files and explain what are its uses in c programming?
What are types of functions?
What does it mean when the linker says that _end is undefined?