Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is a dynamic array in c?

1169


Write a program to print numbers from 1 to 100 without using loop in c?

1095


What are file streams?

1024


I have seen function declarations that look like this

1056


What is the purpose of void in c?

1073


Explain the process of converting a Tree into a Binary Tree.

2685


What is the ANSI C Standard?

1292


Explain the difference between the local variable and global variable in c?

1085


How are variables declared in c?

1113


Is multithreading possible in c?

1025


Which is better pointer or array?

1040


How can I recover the file name given an open stream?

1037


What is scanf () in c?

1137


What are the data types present in c?

1177


What is call by reference in functions?

1466