Operators


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int p = 5, q = 4;
    p *= p + q;
    printf("%d\n", p);
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    45


  1. What will be the output of the following C code?
     #include <stdio.h>
    int main()
    {
    int p = 4, q = 4;
    p /= p / q;
    printf("%d\n", p);
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    4



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Compilation Error

    main.c: In function ‘main’:
    main.c:5:13: error: expected expression before ‘=’ token
    p &&= q;


  1. Operation “n = n * m + n” can also be written as ___________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Operation “n = n * m + n” can also be written as "(p = n * m)!=(n = p + m);" or n = (m + 1)* n; and n *= m + 1;



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    4 1