Operators


  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. 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 k = 3;
    int k = k++ + k;
    printf("%d\n", k);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Compilation Error

    main.c: In function ‘main’:
    main.c:5:13: error: redefinition of ‘k’
    int k = k++ + k;
    ^
    main.c:4:13: note: previous definition of ‘k’ was here
    int k = 3;



  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