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

What is the need for having multibyte data input and output buffers in case of device ports?

893


Explain the properties of a object oriented programming language.

849


How are local and global variables are allocated by compiler.

886


Why do we need a infinite loop in embedded systems development? What are the different ways by which you can code in a infinite loop?

900


How to reduce function call overhead in arm based systems

817


Can we use any function inside isr?

886


What is inversion of control?

858


Can you name any code testing tools?

932


How many types of ipc mechanism you know?

829


Explain the significance of watchdog timer in embedded systems?

905


How can to check the working of a sensor deployed in a project?

1683


Tell me about 3 times you failed.

1007


What are little endian and big endian types of storage? How can you identify which type of allocation a system follows?

924


What is interaction semantics used in embedded systems?

954


What do you do when you get stuck with a problem you can't solve?

823