Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
18BCE2182 ASSESS_2 Q3
//gcc 7.4.0 #include <stdio.h> #include <stdlib.h> #include <omp.h> int main(int argc, char* argv[]) { int i, n, sum, sum1, sum2; int a[100]; n=100; for(i=0; i<n; i++) { a[i]=i+1; } sum=0; sum1=0; sum2=0; #pragma omp parallel #pragma omp sections { #pragma omp section for(i=0; i<(n/2); i++) { sum1= sum1+ (a[i]*a[i]); } #pragma omp section for(i=(n/2); i<n; i++) { sum2= sum2+ (a[i]*a[i]); } } #pragma omp master { sum= sum1 +sum2; printf("Sum : %d",sum); } return 0; }
run
|
edit
|
history
|
help
0
strcmp
Prime no
ARREGLO DE VARIABLES DE TIPO STRUCT
gcc compiler bug.. weird.
150109_RecursividadParImpar
150114_ArrayOrdenado
20171117_FUNCIONES
Lab 5 HW Spring 2017 v0.5
project 5 v.075
object-oriented C by Henry Kroll III www.thenerdshow.com