Decision Making


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int p = 0;
    if (p == 1)
    if (p == 0)
    printf("Inside if block executed...\n");
    else
    printf("Inside else if block executed...\n");
    else
    printf("Inside else block executed...\n");
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Inside else block executed...


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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    It will print nothing.



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    True, 5


  1. The C statement “”if (p == 3 || q == 4) {}”” can be re-written as ___________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    None of these



  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n = 1;
    if (n++)
    printf("True\n");
    else if (n == 2)
    printf("False\n");
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    True