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
Зарегистрируйся сейчас
или Подпишись на будущие тесты