C Programming :: Arrays - Discussion
Home > C Programming > Arrays > MCQs Questions Discussion
13 / 55
What is the following 'C' program doing?
#include<stdio.h>
void 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("\nyes");
}}
#include<stdio.h>
void 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("\nyes");
}}
APutting off all bits which are on in the number n
BTesting whether the individual bits of n are on or off
CThis program would give an error
DNone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!