aboutsummaryrefslogtreecommitdiff
path: root/c/005-smallest_multiple.c
blob: 4924dd1fd066ab086cd606a09ee8313fe8dc486c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <stdbool.h>

int main() {
    int num = 0, i;
    bool end = false;
    while (!end) {
        num += 2;

        for (i = 1; i <= 20; i++) {
            if (num % i != 0) {
                end = false;
                break;
            } else {
                end = true;
            }
        }
    }

    printf("%d", num);

    return 0;
}