What happens if you try to compile and run this program?
What happens if you try to compile and run this program?
#include <stdio.h>
int main(int argc, char *argv[]) {
int i = 10 – 2 / 5 * 10 / 2 – 1;
printf("%d",i);
return 0;
}
Choose the right answer:
A . The program outputs 0
B . The program outputs 4
C . Compilation fails
D . The program outputs 9
E . The program outputs 15
Answer: D
Explanation:
The expression 10 – 2 / 5 * 10 / 2 – 1 is evaluated based on the standard precedence rules in
C. Division and multiplication have higher precedence than addition and subtrac-tion, and they are evaluated from left to right:
Latest CLA-11-03 Dumps Valid Version with 40 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments