#include <stdio.h> int x = 0; int main() { int i = (f() + g()) | g(); //bitwise or int j = g() | (f() + g()); //bitwise or } int f() { if (x == 0) return x + 1; else return x - 1; } int g() { return x++; }
a) i value is 1 and j value is 1
b) i value is 0 and j value is 0
c) i value is 1 and j value is undefined
d) i and j value are undefined
What will be the final values of i and j in the following C code?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will be the final values of i and j in the following C code?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!