aboutsummaryrefslogtreecommitdiff
path: root/src/1
diff options
context:
space:
mode:
Diffstat (limited to 'src/1')
-rw-r--r--src/1/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/1/main.c b/src/1/main.c
new file mode 100644
index 0000000..975c495
--- /dev/null
+++ b/src/1/main.c
@@ -0,0 +1,13 @@
1#include <omp.h>
2#include <stdio.h>
3
4int main() {
5 long long int total = 1, i;
6#pragma omp parallel for reduction(*:total)
7 for(i = 1; i <= 20; i++) {
8 // printf("working in thread %d\n", omp_get_thread_num());
9 total = total * i;
10 }
11 printf("total: %lld\n", total);
12}
13