Operators


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












  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    3 4 4


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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    num1 is 99



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    12


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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    1 3



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Compilation Error

    main.c: In function ‘main’:
    main.c:5:13: error: redefinition of ‘k’
    int k = k++ + k;
    ^
    main.c:4:13: note: previous definition of ‘k’ was here
    int k = 3;