Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
18BCE2182 MIDTERM PART-B CRITICAL
//gcc 7.4.0 #include <stdio.h> #include <stdlib.h> #include <omp.h> int main(void) { int max, min, n; max = 0; min = 9999; n = 10; int arr[]={10,25,37,96,81,43,55,64,79,110}; for(int i=0; i<n; i++) { printf("%d,\t",arr[i]); } printf("\n"); #pragma omp parallel { for(int i=0; i<n; i++) { #pragma omp critical { if(arr[i]>max) { max=arr[i]; } } } for(int i=0; i<n; i++) { #pragma omp critical { if(arr[i]<min) { min=arr[i]; } } } printf("Max of array: %d\n",max); printf("Min of array: %d\n",min); } return 0; }
run
|
edit
|
history
|
help
0
string.c
Lab6 v0.5 Sin,cos,tan,cot
tst2.c
formatting_input_and_output
Revprint
18BCE2182 LAB FAT-2-A-i
Lab 9 v1
18BCE2182 ASSESS_1 Q2-2
Lior Yehieli Lesson
Sorting Character array using Qsort