Operators


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int k = 3;
    int L = ++k + k;
    printf("%d\n", L);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    8


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int k = 2;
    int L = k++ + k;
    printf("%d\n", L);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    5



  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n = 15, m = 15;
    if (n = 10)
    m--;
    printf("%d, %d", n, m--);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    10, 14


  1. For which of the following, “PI++;” code will fail?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    #define PI 3.14



  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