summaryrefslogtreecommitdiff
path: root/3/6_control/24_while_loop.c
blob: 18a6c708a88e27ce615829e93a903481b2a75038 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// while (test)
//   body
//
//  goto test;
//  loop:
//      body;
//  test:
//      t = test;
//      if (t)
//          goto loop;

short loop_while(short a, short b)
{
    short result = 0;
    while (a > b) {
        result = result + a*b;
        a = a - 1;
    }
    return result;
}

int main(void) {
    return 0;
}