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 function of dma controlled in embedded system?
What is the need for having multibyte data input and output buffers in case of device ports?
Why continuous integration is important?
What is refactoring? Name three common refactorings.
Why are interfaces important?
Tell me what is microcontroller?
Who are the gang of four? Why should you care?
Explain the software analysis process, such as code analysis, code metrics, and system risk analysis or software reliability.
How can you ensure that debugging a program while it's being used will not affect its functionality?
Tell me what is the need for an infinite loop in embedded systems?
Why is model transformations used in the embedded system?
Tell me why is java mostly used in embedded systems?
Explain what is semaphore?
How are macros different from functions?
Explain the characteristics of embedded system?