aboutsummaryrefslogtreecommitdiff
path: root/src/1
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-10-13 11:28:07 +0100
committerAkshay <[email protected]>2021-10-13 11:28:07 +0100
commitaa13912e3ec97705d47207003afb6845c6859bc8 (patch)
treea3116f9dfef701b6904f457be539dd03a3f74cf3 /src/1
init
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