From aa13912e3ec97705d47207003afb6845c6859bc8 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 13 Oct 2021 15:58:07 +0530 Subject: init --- src/1/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/1/main.c (limited to 'src/1/main.c') 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 @@ +#include +#include + +int main() { + long long int total = 1, i; +#pragma omp parallel for reduction(*:total) + for(i = 1; i <= 20; i++) { + // printf("working in thread %d\n", omp_get_thread_num()); + total = total * i; + } + printf("total: %lld\n", total); +} + -- cgit v1.2.3