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;
}
Discussion:
58 comments Page 3 of 6.
Parth said:
1 decade ago
The first two have to be same and there is only one matching option to that, so common sense if not logic.
Rupinderjit said:
1 decade ago
@safi
Operation and bit manipulation is different, but coincidentally result is same, not a big issue.
Operation and bit manipulation is different, but coincidentally result is same, not a big issue.
Umesh Pandey said:
9 years ago
Tricky method.
i|j&j|i, i|j&j|i gives same value.
The option is only 12,12 ie A.
i|j&j|i, i|j&j|i gives same value.
The option is only 12,12 ie A.
(1)
Sujithra said:
9 years ago
What will be the answer when 1100&1000 occur in a program? please explain in detail.
Levin said:
1 decade ago
@Abinandank :Thanks for spending your valuable time with us. Its been very useful.
Sushant said:
9 years ago
@Kavi.
& is a bitwise operator.
Whereas;
&& is a logical operator.
& is a bitwise operator.
Whereas;
&& is a logical operator.
Karthika said:
1 decade ago
Then, which operator is used to denote "power-off" ?
Don't we use ^ ?
Don't we use ^ ?
Kavi said:
10 years ago
Anyone can explain?
What is the difference between i&j and i&&j?
What is the difference between i&j and i&&j?
Alok said:
1 decade ago
Lot's of thank's all the people those who given the answer of this question.
Raghavi said:
8 years ago
Thanks for the explanation friends. It helps me to understand easily.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers