Interactive Quiz for Chapter 5

Question
Your Answer Result/Explanation
5.1
How many times is the following loop executed?
    int count = 1;
    while (count < 5) 
    {
      count += 3;
    }
                  
5.2
How many times is the following loop executed?
    int count = 1;
    do 
    {
      count += 3;
    } while (count < 5);
                  
5.3
How many times is the following loop executed?
    for (int count = 1; count < 5; count += 3) 
    {
      // Execute the body
    }
                  
5.4
What is count after the loop is finished?
    int count = 1;
    do 
    {
      count += 3;
    } while (count < 5);
                  
5.5
What is the output of the following code?
    for (int i = 1; i < 10; i += 2) 
    {
      cout << i;
    }
                  
5.6
What is the output of the following code?
    int x = 85;
    for (int i = 2; i < x; i++) 
    {
      if (x % i == 0) 
      {
        cout << i;
        break;
      }
    }
5.7
What is the output of the following code?
    int x = 85;
    for (int i = 2; i < x; i++) 
    {
      if (x % i == 0) 
      {
        cout << i << " ";
        continue;
      }
    }