Select all the statements that are true
int a = 1;
int b;
int c;
b = a || 1; // 1
b = !b; // 2
a = a || b; // 3
c = a && (a||b); //4
Explanation
int a = 1;
int b;
int c;
b = a || 1; // 1:  1 || 1 == 1
b = !b; // 2: !1 == 0
a = a || b; // 3: 1 || 0 == 1
c = a && (a||b); //4: 1 && (1||0) == 1

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes