diff options
author | Oskar <[email protected]> | 2024-08-29 13:37:00 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-08-29 13:37:00 +0200 |
commit | 9094c8aa159ee2386fa1d2ff19cbdc73f321303b (patch) | |
tree | b0eaccac1c08cd2e1d485227ec73342373a25704 | |
parent | 743c47c671347a0ac0f8f64b7117b48c65bab073 (diff) |
forgot to do this exercise for some reason
-rw-r--r-- | 5p3.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -2,11 +2,17 @@ /* * - * Description + * 5.3 * * */ int main () { + + int sum = 0; + int val = 1; + while (val <= 10 && (sum += val, ++val)); + + std::cout << sum << std::endl; return 0; } |