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 is it better to use multi-threading polling instead of a single threading model?
Tell me what is the need for an infinite loop in embedded systems?
Why is it better to use multi-threading polling then single threading model?
What software configuration management tools are you familiar working with?
Describe a software development life cycle that you've managed.
Mention how I/O devices are classified for embedded system?
How to implement a fourth order butter worth lp filter at 1 khz if sampling freuency is 8 khz?
How do you learn about the latest technology trends?
Tell me what is the difference between hard real-time and soft real-time os?
What is your experience with technical documentation?
Explain difference between risc and cisc processor?
Tell me why do we need virtual device drivers when we have physical device drivers?
What is inversion of control?
Explain the difference between mutexes vs semaphores?
Tell me what is microcontroller?