Operators


  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. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    18, 6, 9


  1. Do logical operators in the C language are evaluated with the short circuit?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    True



  1. What will be the final value of n4 in the following C code?
    #include <stdio.h>
    int main()
    {
    int n1 = 8, n2 = 4, n3 = 4;
    int n4;
    n4 = n2 + n3 == n1;
    printf("%d", n4);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    1


  1. What is the result of a logical or relational expression in C?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    0 or 1



  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int p = 12, q = 6, r = 4;
    q != !p;
    r = !!p;
    printf("%d\t%d", q, r);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    6 1