Operators


  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    int num = 0;
    if (num = 0)
    {
    printf("It's zero\n");
    }
    else
    {
    printf("It's not zero\n");
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    It's not zero


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n = 5;
    if (n & (n = 6))
    printf("True %d\n", n);
    else
    printf("False %d\n", n);

    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    True 6



  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int p = 3;
    if (4 |(p = 4))
    printf("p is %d\n", p);
    else
    printf("%d\n", p);

    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    p is 4


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n = -7;
    if (!0 == 1)
    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 output of the following C code?
    #include <stdio.h>
    int main()
    {
    if (~2 == 3)
    {
    printf("Yes\n");
    }
    else
    {
    printf("No\n");
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    No