Monday, February 20, 2017

C Programming Questions with Explanation

The following statement ::
     
               printf("%d",++5);
will print:

a)5  b) 6  c) error  d)garbage

Answer:: (C)

Explanation::

The statement will be expanded like
         5=5+1;
i.e. a constant on left side of expression which is not allowed in 'C' hence it will generate error.

No comments:

Post a Comment

Tambola

Tambola Quiz Game 4x4 (Called-Out Answers Highlight Only) Tambola Quiz Game 🎲 (4x4 Grid) - Called Out Answers Highlight O...