Home » C Programming » Operators » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    char p = 'p';
    int q = (p % 10)++;
    printf("%d\n", q);
    }
    1. 10
    2. Compilation Error
    3. p
    4. Runtime Error
    5. None of these
Correct Option: B

Compilation Error

main.c: In function ‘main’:
main.c:5:25: error: lvalue required as increment operand
int q = (p % 10)++;



Your comments will be displayed only after manual approval.