summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-08-29 13:37:00 +0200
committerOskar <[email protected]>2024-08-29 13:37:00 +0200
commit9094c8aa159ee2386fa1d2ff19cbdc73f321303b (patch)
treeb0eaccac1c08cd2e1d485227ec73342373a25704
parent743c47c671347a0ac0f8f64b7117b48c65bab073 (diff)
forgot to do this exercise for some reason
-rw-r--r--5p3.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/5p3.cpp b/5p3.cpp
index 58d5fbf..734f367 100644
--- a/5p3.cpp
+++ b/5p3.cpp
@@ -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;
}