Operators


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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    20


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    if (7 & 8)
    printf("All");
    if ((~7 & 0x000f) == 8)
    printf("that glitters is not gold.\n");
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    that glitters is not gold



  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    int n1 = 100;
    int n2 = sizeof(n1++);
    printf("n1 is %d", n1);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    n1 is 100


  1. What will be the output of the following C code?
    #include 
    void main()
    {
    int n = 6;
    int *ptr1 = &n;
    int *ptr2 = ptr1++;
    int Res = ptr1 - ptr2;
    printf("%d", Res);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    1



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    4 5 5