Decision Making


  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int num = 12;
    if (num < 13)
    {
    T:
    cout << num;
    goto T;
    }
    break;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Because the break statement need to be presented inside a loop or a switch statement.


  1. What is the output of this program?
    #include 
    using namespace std;
    int main ()
    {
    int i;
    for (i = 10; i > 0; i--)
    {
    cout << i<<" ";
    if (i == 8)
    break;
    }
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In this program, We are printing the numbers in reverse order but by using break statement we stopped printing on 8.



  1. The destination statement for the goto label is identified by what label?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    goto label is identified by ":"


  1. The switch statement is also called as?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The switch statement is used to choose the certain code to execute, So it is also called as selective structure.



  1. The if..else statement can be replaced by which operator?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    In the conditional operator, it will predicate the output using the given condition.