Home » C Programming » Operators » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n1 = 5, n2 = 0, n3 = 7;
    n1 > n2 ? printf("%d", n3) : return n3;
    }
    1. 5
    2. 7
    3. Compilation Error
    4. Runtime Error
    5. None of these
Correct Option: C

Compilation Error

main.c: In function ‘main’:
main.c:5:38: error: expected expression before ‘return’
n1 > n2 ? printf("%d", n3) : return n3;
^~~~~~



Your comments will be displayed only after manual approval.