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

Find All Triplets with Zero Sum

  Problem Explanation: Find All Triplets with Zero Sum The task is to find all unique triplets in an array that add up to zero. A triplet c...