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 are the types of type specifiers?

981


How can I read/write structures from/to data files?

921


What is the need of structure in c?

1045


explain how do you use macro?

1097


What are the types of operators in c?

999


When should structures be passed by values or by references?

992


What is pass by reference in c?

1142


Explain how can a program be made to print the line number where an error occurs?

1145


Explain about C function prototype?

1025


What is a void pointer? When is a void pointer used?

1018


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

2104


What is the use of a semicolon (;) at the end of every program statement?

1410


Is swift based on c?

1050


List the variables are used for writing doubly linked list program.

1965


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2036