C Programming - Bitwise Operators - Discussion
Discussion Forum : Bitwise Operators - Point Out Correct Statements (Q.No. 4)
4.
Which of the following statements are correct about the program?
#include<stdio.h>
int main()
{
unsigned int m[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
unsigned char n, i;
scanf("%d", &n);
for(i=0; i<=7; i++)
{
if(n & m[i])
printf("yes");
}
return 0;
}
Discussion:
13 comments Page 2 of 2.
Amit tiwari said:
8 years ago
I am not getting this, Someone please explain it.
Rahul said:
8 years ago
It is clear now. Thanks @Abhishek.
Quein said:
7 years ago
Please explain it clearly.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers