Main(){ int c = 5; printf("%d", main||c);}

A) none of the above
B) 0
C) 5
D) 1
Explanation: if we use main|c then error, illegal use of pointer

Showing Answers 1 - 4 of 4 Answers

Chandra Shekhar Chaubey

  • Feb 3rd, 2006
 

Ans will be 1

Regards,

  Was this answer useful?  Yes

puneet

  • Jun 30th, 2006
 

Hi frnds, I have tried this question, can anyone plz explain, How it will come, there is one point to consider:: simply "main" is there without function symbol ( ), i dont know how compiler is assuming this,

  Was this answer useful?  Yes

Preetham

  • Sep 25th, 2006
 

Here || operator is used, which returns 1  when first operand is not zero, without evaluating second operand, so it returns 1 because the address of main function is not zero.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions