What will be printed out as a result of the following code execution?
#include <iostream>

int main() {
    int result = 0;
    while (result < 5)
        ++result;
    do result += 2;
    while (++result < 5);
    std::cout << result;    
}
Explanation
Get an explanation when it's available:

@maptun thanks! fixed formatting

2017 Dec 6, 12:59:12 PM

Code not formated What will be printed out as a result of the following code execution? #include <iostream> int main() { int result = 0; while (result < 5) ++result; do result += 2; while (++result < 5); std::cout << result; }

2017 Sep 6, 12:52:18 PM

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести