summaryrefslogtreecommitdiff
path: root/3/6_control/24_while_loop.c
diff options
context:
space:
mode:
authorMike Vink <mike@pionative.com>2024-05-22 08:58:05 +0200
committerMike Vink <mike@pionative.com>2024-05-22 08:58:05 +0200
commit758543aef80c3b3568a20b0dff20202c796a4819 (patch)
tree7ae11e919fb961b72f07ab5a6e9516d814082823 /3/6_control/24_while_loop.c
parent51169f5f9ab178a4ddfe9dac461405a71c9c0f94 (diff)
24 and 25
Diffstat (limited to '3/6_control/24_while_loop.c')
-rw-r--r--3/6_control/24_while_loop.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/3/6_control/24_while_loop.c b/3/6_control/24_while_loop.c
index a3367fc..18a6c70 100644
--- a/3/6_control/24_while_loop.c
+++ b/3/6_control/24_while_loop.c
@@ -11,10 +11,10 @@
short loop_while(short a, short b)
{
- short result = ;
- while () {
- result = ;
- a = ;
+ short result = 0;
+ while (a > b) {
+ result = result + a*b;
+ a = a - 1;
}
return result;
}