Sunday, 19 February 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