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.
Raghavi said:
8 years ago
Thanks for the explanation friends. It helps me to understand easily.
Nilesh said:
8 years ago
@Sujithra.
The ans will be 1000.
In &(AND) operation,
1 & 1=1.
1 & 0=0.
0 & 1=0.
0 & 0=0.
The ans will be 1000.
In &(AND) operation,
1 & 1=1.
1 & 0=0.
0 & 1=0.
0 & 0=0.
Chandru said:
8 years ago
Thanks @Vedhashree.
Anchan said:
8 years ago
Thanks @Vedhashree.
Manoja V. said:
8 years ago
Thanks @Vedhashree.
Ramya said:
8 years ago
Thanks @Vedhashree.
Harshada said:
7 years ago
Not understood. Please help me.
Sanket said:
6 years ago
Thanks @Vedhashree.
Swaroop said:
6 years ago
Thanks @Vedashree.
Mukta said:
5 years ago
Thank you everyone for explaining the answer.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers