Q: What is the output of this C code?
Options:
a) TRUE 1
b) TRUE 2
c) TRUE 1 TRUE 2
d) No output
Answer: A
 | #include <stdio.h> | 
 | int main() | 
 | { | 
 |     int a = 10; | 
 |     if (a == a--) | 
 |         printf("TRUE 1\t"); | 
 |     a = 10; | 
 |     if (a == --a) | 
 |         printf("TRUE 2\t"); | 
 | } | 
Options:
a) TRUE 1
b) TRUE 2
c) TRUE 1 TRUE 2
d) No output
Answer: A
No comments:
Post a Comment