Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
18BCE2182 LAB FAT-2(A)-(i)
//gcc 7.4.0 #include <omp.h> #include <stdio.h> #include <time.h> static long num_steps = 100000; double steps; int main(int argc, char* argv[]) { int i; double start, end, x, pi, sum = 0.0; steps = 1.0/(double) num_steps; start = omp_get_wtime(); #pragma omp parallel for private(x) reduction(+:sum) for (i=1; i<= num_steps; i++) { x = (i-0.5)*steps; sum = sum + 4.0/(1.0+x*x); } pi = sum / num_steps; printf ("\npi = %6.8f\n", pi); end = omp_get_wtime(); printf("\n\nExecution Time: %f",(end-start)); return 0; }
run
|
edit
|
history
|
help
0
PtStrCpy
strcat
void *
hw 2
Quadratic Formula
18BCE2182 ASSESS_1 Q2-2
Intro to Arrays with comments
Rationale Zahlen
Funciones en C
Add.c