main() {
int a=5, b=6,5;
c=(b++ == 6) || (--a < 2);
printf("%d %d %d", a, b, c)
}
;
Correct answer: +1
Incorrect answer: 0
Answers
Answered by
1
Answer:
(d) -32768 to 32767 is the correct answer
Answered by
0
Answer:
The output of the given code is 5 7 1.
Explanation:
- The first line of the code declares and initializes the variables used in the program.
- There are three variables a=5, b=6, and c which is not initialized.
- The next line contains a series of boolean expressions whose result is assigned to the variable c.
- The expression first checks whether the value of variable b is equal to 6 or not. If the value is equal to 6, then the result is logic high (1). If not, the result is logic low (0).
- Initially, as b=6, the result is logic high(1). The value of b is then incremented to b=7.
- Now, the expression first decrements the value of a to a=4 and then checks whether this value is less than 2 or not. If the value is less than 2, then the result is logic high(1). If not, the result is logic low(0).
- The value of a after decrementing is 4, which is less than 2. Therefore, the result is logic low(0).
- These two results are then logically ORed. As per the truth table of the OR gate, a logic high(1) and logic low(0) inputs will give the output as logic high(1). This value is assigned to variable c.
- The final values of a, b, and c are printed.
The final values of a, b, and c that is printed are 5, 7, and 1.
#SPJ2
Similar questions