C Programming - Structures, Unions, Enums - Discussion

Discussion Forum : Structures, Unions, Enums - Find Output of Program (Q.No. 7)
7.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    int i=4, j=8;
    printf("%d, %d, %d\n", i|j&j|i, i|j&j|i, i^j);
    return 0;
}
12, 12, 12
112, 1, 12
32, 1, 12
-64, 1, 12
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
58 comments Page 4 of 6.

Madhu said:   1 decade ago
I can't understand what is in printf statement. Can you explain?

Mindmaster said:   9 years ago
Operators of same precedence are executed from left to right.

Arvind &himanshu said:   1 decade ago
Thanks vadhashree.

For brief explanation. :-).

Pavan said:   1 decade ago
The output of XOR is 1 if 2 inputs are similar.

Shakshi said:   9 years ago
Thanks, @Vadhashree. it's a clear explanation.

Raji said:   8 years ago
Thank you to all your answers and explanation.

Mukta said:   5 years ago
Thank you everyone for explaining the answer.

Ani said:   2 decades ago
Can anyone explain this in a detailed way?

Javed said:   1 decade ago
Can anyone elaborate giving small example?

Sibaram said:   1 decade ago
Can't under stand please explain detail.


Post your comments here:

Your comments will be displayed after verification.