Hits/True | False | Line | Source |
---|---|---|---|
1 | /* File prime.c ---------------------------------------------- */ | ||
2 | /* This example demonstrates some elementary CTC++ properties. */ | ||
3 | /* Not meant to be any good solution to the 'prime' problem. */ | ||
4 | |||
5 | #include "io.h" | ||
6 | #include "calc.h" | ||
7 | |||
Top | |||
1 | 8 | int main(void) | |
9 | { | ||
10 | unsigned prime_candidate; | ||
11 | |||
3 | 1 | 12 | while((prime_candidate = io_ask()) > 0) |
13 | { | ||
2 | 1 | 14 | if (is_prime(prime_candidate)) |
15 | io_report(prime_candidate, "IS a prime."); | ||
16 | else | ||
17 | io_report(prime_candidate, "IS NOT a prime."); | ||
18 | } | ||
1 | 19 | return 0; | |
20 | } |