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...

write a program to display reverse of a number using for
loop?

Answer Posted / hema

int main()
{
int a = 234;
printf("\n");
while( a != 0)
{
printf("%d",a%10);
a /= 10;
}
return 0;
}
______________________________________________________

use below program if you want to store value in another
variable
______________________________________________________
int main()
{
int a = 234;
int b = 0;
printf("\n");
while( a != 0 )
{
b = b *10 + (a%/10);
a /= 10;
}
printf("\n values in revers order= %d \n",b);
return 0;
}

Is This Answer Correct ?    22 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between exit() and _exit() function in c?

1080


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

1007


What is the difference between mpi and openmp?

1306


What are the rules for identifiers in c?

1073


Explain indirection?

1147


What is the difference between volatile and const volatile?

994


Combinations of fibanocci prime series

1621


Is c easier than java?

1086


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

2300


why wipro wase

2316


What is quick sort in c?

1096


How can I manipulate strings of multibyte characters?

1115


Explain how can I pad a string to a known length?

1201


Write a C program in Fibonacci series.

1095


Can we access the array using a pointer in c language?

1054