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


Please Help Members By Posting Answers For Below Questions

write a programming in c to find the sum of all elements in an array through function.

1705


How is a macro different from a function?

653


How does pointer work in c?

616


What is declaration and definition in c?

523


Distinguish between actual and formal arguments.

589






How to establish connection with oracle database software from c language?

1675


int far *near * p; means

3119


When should you not use a type cast?

657


can any one tel me wt is the question pattern for NIC exam

1556


How can I implement a delay, or time a users response, with sub-second resolution?

621


Which is an example of a structural homology?

784


What are types of preprocessor in c?

617


Explain what are header files and explain what are its uses in c programming?

626


What are types of functions?

564


What does it mean when the linker says that _end is undefined?

629