Chapter 10 Exercise Set 1: CPE PracticeΒΆ

  1. What is the output of the following program?

    #include <iostream>
    using namespace std;
    
    int main() {
        int i = 0;
        for (float f = .008; f < 1e2; f *= 1e1)
            i++;
        cout << i << endl;
        return 0;
    }
    
    1. 2

    2. 3

    3. 4

    4. 5