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

main()
{
unsigned int k = 987 , i = 0;
char trans[10];
do {
trans[i++] =(char) (k%16 > 9 ? k%16 - 10 + 'a' : '\0' );
} while(k /= 16);
printf("%s\n", trans);
}

Answer Posted / lakshman

first case k=987, i=0.
trans[i++]=(char)(k%16>9?k%16-10+'a':''); means
trans [0]=char(987%16(=61)>9)condition is true so k%16-10+'a' value is print. that value is equal to 61-10|+(ascii value of a, that is equal to 97) so finally we get 98 and that is equal to b,
second case k=61, i=1 this will gives d
third case k=3, i=2 this gives null character.
the final answer is bd

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what’s a signal? Explain what do I use signals for?

1155


What does %d do?

1275


What does malloc () calloc () realloc () free () do?

1061


Why is c called a mid-level programming language?

1201


What are the 5 types of organizational structures?

1071


What is the advantage of c?

1127


What functions are used in dynamic memory allocation in c?

1081


What functions are in conio h?

1186


What is difference between constant pointer and constant variable?

1306


What is c value paradox explain?

1089


What does c mean before a date?

1176


swap 2 numbers without using third variable?

1129


What is a buffer in c?

997


What is difference between stdio h and conio h?

1378


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2073