Operators


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int k = 2;
    if (k++ && (k == 3))
    {
    printf("Yes\n");
    }
    else
    {
    printf("No\n");
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Yes


  1. What will be the final value of L in the following C code?
    #include <stdio.h>
    int main()
    {
    int k = 12, L = 0;
    if (k || (L = k + 12))
    //do something
    ;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    it will not show any output because we are not using printf for print any value as output.



  1. What will be the final value of L in the following C code?
    #include <stdio.h>
    int main()
    {
    int k = 0, L = 0;
    if (k && (L = k + 12))
    //do something
    ;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    it will not show any output because we are not using printf for print any value as output. but the value of L will be 0.


  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    int n1 = 1, n2 = 3, n3 = 4;
    int R = n1 & n2 | n3;
    printf("%d", R);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    5



  1. What will be the output of the following C code?












  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    16