Wednesday, April 1, 2015

Challenge Question 1: Loop ( break / continue )

What does this code do?

#include<iostream>

using namespace std;

int main(){
    int MAX = 50;
    int counter = 0;

    while (counter++ < MAX){
        if (counter % 2 != 0)
            continue;

        cout << counter << endl;
       
        if (counter == 20)
            break;
    }
    return 0;
}