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
Why would you choose java in embedded systems?
What is endianness of a system and how do different systems communicate with each other?
Have you developed software testing procedures for new systems and performed qa, quality assurance, or audits?
What are the differences between analytical and computational modeling?
Why is the single responsibility principle important?
What is the difference between asynchrony and concurrency?
What elements of oo design are most prone to abuse? How would you mitigate that?
Differentiate between mutexes vs semaphores.
Explain what is the need for an infinite loop in embedded systems?
Can you name any code testing tools?
Explain me what is the main function of multiplexed address/data bus?
Do you know what is priority inheritance?
What do you do when you get stuck with a problem you can't solve?
What happens when recursive functions are declared inline?
Explain me how does the interrupt architecture works?