Home » C Programming » Operators » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    int main()
    {
    int p = 2, q = 2, r = 2;
    printf("%d, %d, %d", ++p + ++p + p++, p++ + ++q, ++r + r++ + p++);
    }
    1. 2, 2, 2
    2. 6, 9, 18
    3. 9, 6, 18
    4. 18, 6, 9
    5. None of these
Correct Option: D

18, 6, 9



Your comments will be displayed only after manual approval.