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
What is the need for having multibyte data input and output buffers in case of device ports?
Explain the properties of a object oriented programming language.
How are local and global variables are allocated by compiler.
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?
How to reduce function call overhead in arm based systems
Can we use any function inside isr?
What is inversion of control?
Can you name any code testing tools?
How many types of ipc mechanism you know?
Explain the significance of watchdog timer in embedded systems?
How can to check the working of a sensor deployed in a project?
Tell me about 3 times you failed.
What are little endian and big endian types of storage? How can you identify which type of allocation a system follows?
What is interaction semantics used in embedded systems?
What do you do when you get stuck with a problem you can't solve?