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

How do you use a pointer to a function?

1050


What's the total generic pointer type?

1023


How can I automatically locate a programs configuration files in the same directory as the executable?

1125


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

3049


How can I trap or ignore keyboard interrupts like control-c?

1036


What do you mean by invalid pointer arithmetic?

1025


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2830


State the difference between realloc and free.

1047


Are local variables initialized to zero by default in c?

1003


console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

1123


What is pragma in c?

1160


What is structure and union in c?

1096


How does struct work in c?

1040


Explain what standard functions are available to manipulate strings?

1043


List the difference between a 'copy constructor' and a 'assignment operator' in C?

1057