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
List out various uses of timers in embedded system?
Tell me why does pre-emptive multi-threading used to solve the central controller problem?
How can you reduce memory requirements in embedded systems?
Explain what is size of character, integer, integer pointer, character pointer?
Explain the difference between a microcontroller and an embedded system?
List out some of the commonly found errors in Embedded Systems?
Explain what is interrupt latency? How can you reduce it?
What is the use of volatile keyword?
What are the different types of embedded systems?
What is interrupt latency and how can we decrease it?
Explain me how does the interrupt architecture works?
What are some alternate ways to store data other than a relational database? Why would you do that, and what are the trade-offs?
What is the purpose of a watchdog timer?
What is the scope of a function that is declared as static?
What is kernel paging?