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

look at following code

void foo(void) {
unsigned int a = 6;
int b = -20;
int c = (a+b > 6) ? 1:0;
}
o/p is 1 why
explain promotion rules

Answer Posted / nitin sharma

Compiler will convert variable b to unsigned int b and then do the addition. Which will be greater than 6 and you got 1.

Is This Answer Correct ?    38 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List out various uses of timers in embedded system?

823


Tell me why does pre-emptive multi-threading used to solve the central controller problem?

802


How can you reduce memory requirements in embedded systems?

833


Explain what is size of character, integer, integer pointer, character pointer?

812


Explain the difference between a microcontroller and an embedded system?

842


List out some of the commonly found errors in Embedded Systems?

902


Explain what is interrupt latency? How can you reduce it?

811


What is the use of volatile keyword?

835


What are the different types of embedded systems?

809


What is interrupt latency and how can we decrease it?

739


Explain me how does the interrupt architecture works?

838


What are some alternate ways to store data other than a relational database? Why would you do that, and what are the trade-offs?

782


What is the purpose of a watchdog timer?

871


What is the scope of a function that is declared as static?

847


What is kernel paging?

769