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



look at following code void foo(void) { unsigned int a = 6; int b = -20; int c = (a+b &g..

Answer / 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

More Embedded Systems AllOther Interview Questions

what is the command/instruction in ARM that does not do anything or does not execute any instruction ? (except NOP instruction)

0 Answers   Bosch,


Tell me what is rtos?

0 Answers  


hi i want to learn embedded system course. can anyone tel me which training center is best in chennai to learn embedded system? plz help me

1 Answers  


Why do we need virtual device drivers when we have physical device drivers?

0 Answers  


Tell me what are the functional requirements that are used in the embedded systems?

0 Answers  






What is the purpose of using critical sections?

0 Answers  


Tell me whether we can use semaphore or mutex or spinlock in interrupt context in linux kernel?

0 Answers  


Would you call yourself a craftsman (craftsperson) and what does that word mean to you?

0 Answers  


Describe, in as much detail as you think is relevant, as deeply as you can, what happens when I type "cnn.com" into a browser and press "go".

0 Answers  


Explain what are the uses of the keyword static?

0 Answers  


Discuss the concept of yagni and explain something you did recently that adhered to this practice.

0 Answers  


What is mutex precisely used for?

2 Answers  


Categories