Top

Discussion

Predict the output of following program.

#include 

#define MOBILE  0x01
#define LAPPY   0x02

int main()
{
 unsigned char  item=0x00;

 item |=MOBILE;
 item |=LAPPY;

 printf("I have purchased ...:");
 if(item & MOBILE){
  printf("Mobile, ");
 }
 if(item & LAPPY){
  printf("Lappy");
 }

 return 1;
}

 

  • A.I have purchased ...:
  • B.I have purchased ...:Mobile, Lappy
  • C.I have purchased ...:Mobile,
  • D.
    I have purchased ...:Lappy

Answer: B

No answer description available for this question.

No comment is present. Be the first to comment.
Loading…

Post your comment