diff options
Diffstat (limited to 'debug/programs/counting_loop.c')
-rw-r--r-- | debug/programs/counting_loop.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/debug/programs/counting_loop.c b/debug/programs/counting_loop.c new file mode 100644 index 0000000..2116e52 --- /dev/null +++ b/debug/programs/counting_loop.c @@ -0,0 +1,17 @@ +#include <stdio.h> +#include <string.h> +#include <stdint.h> +#include <stdlib.h> + +int main() +{ + int sum = 0; + int counter = 0; + + while (counter < 10) { + counter = counter + 1; + sum = sum + counter; + } + + return counter; +} |