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 / 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 |
What is dma in an embedded system?
Who are the gang of four? Why should you care?
Tell me what is the difference between hardware design and software design?
Infinite loops often arise in embedded systems. How does you code an infinite loop in c?
What happens when recursion functions are declared inline?
How do you identify hardware errors?
Why are patterns important?
Explain the differences between analytical and computational modeling?
What is spin lock?
Tell me what could be the reasons for a system to have gone blank and how would you debug it?
What are the 4 types of inheritance relationship?
Tell me what is the purpose of using critical sections?