What will be the final values of i and j in the following C code?
#include int x = 0;int f(){ if (x == 0) return x + 1; else return x - 1;}int g(){ return x++;}int main(){ int i = (f() + g()) | g(); //bitwise or int j = g() | (f() + g()); //bitwise or}
#include int x = 0;int f(){ if (x == 0) return x + 1; else return x - 1;}int g(){ return x++;}int main(){ int i = (f() + g()) | g(); //bitwise or int j = g() | (f() + g()); //bitwise or} What will be the final values of i and j in the following C code?
#include <stdio.h>int x = 0;int f(){ if (x == 0) return x + 1; else return x - 1;}int g(){ return x++;}int main(){ int i = (f() + g()) | g(); //bitwise or int j = g() | (f() + g()); //bitwise or} Correct Answer i value is 1 and j value is undefined
মোঃ আরিফুল ইসলাম
Feb 20, 2025