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

Differentiate between a for loop and a while loop? What are it uses?

1170


What does %2f mean in c?

1210


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

1097


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1268


What are the Advantages of using macro

1165


Why cant I open a file by its explicit path?

1027


How can you pass an array to a function by value?

1115


What are the advantages of the functions?

1158


What are the difference between a free-standing and a hosted environment?

1284


What is hungarian notation? Is it worthwhile?

1218


Define C in your own Language.

1072


What functions are used in dynamic memory allocation in c?

1075


What is the difference between if else and switchstatement

1926


Explain what will the preprocessor do for a program?

1063


Why should I prototype a function?

1182