Home » C++ Programming » Decision Making » Question
  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. 10 0
    2. 0 10 8
    3. 10 9 8
    4. Compilation Error
    5. None of these
Correct Option: C

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



Your comments will be displayed only after manual approval.