Operators


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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Value of q is 19


  1. Which of the following is not an arithmetic operation?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    a != 10;



  1. What is the precedence of arithmetic operators (from highest to lowest)?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    %, *, /, +, –


  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 output of the following C code?
    #include <stdio.h>
    void main()
    {
    int num1 = 5;
    int num2 = 10 % 3 * 12 / 4;
    printf("Value of num is %d", num2);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Value of num is