What will be the final values of i and j in the following C code?#include int x = 0;int main(){int i = (f() + g()) | g();

🎲 Try a Random Question  |  Total Questions in Quiz: 113  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
C Programming Practice Test: Miscellaneous Topics — practice the complete quiz, review flashcards, or try a random question.


What will be the final values of i and j in the following C code?<br>#include <stdio.h><br>int x = 0;<br>int main()<br>{<br>int i = (f() + g()) | g(); <span class=co1">//bitwise or<br>int j = g() | (f() + g()); <span class="co1">//bitwise or<br>}<br>int f()<br>{<br>if (x == 0)<br>return x + 1;<br>else<br>return x - 1;<br>}<br>int g()<br>{<br>return x++;<br>}"






ADVERTISEMENT