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

Compilation Error

main.c: In function ‘main’:
main.c:5:27: error: lvalue required as left operand of assignment
float var = q + p /= p / q;



Your comments will be displayed only after manual approval.