Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
18BCE2182 ASSESS_2 Q-1
//gcc 7.4.0 #include <stdio.h> #include <stdlib.h> #include <omp.h> int main(void) { int count, cp, i, j; cp=0; int arr[10]; printf(" Number of processors available: ",omp_get_num_procs()); #pragma omp parallel for for(i=0; i<10; i++) { arr[i]=rand(); count=0; for(j=1; j<=arr[i]; j++) { if(arr[i]%j==0) { count++; } } if(count==2) { cp++; printf("%d is a Prime Number\n",arr[i]); printf("Thread id for number %d is %d",arr[i],omp_get_thread_num()); } } return 0; }
run
|
edit
|
history
|
help
0
Swiss Infotech Tutorial
day 2
NOT a String in C
bitwise operations
printing numbers without using loop
18BCE2182 MIDTERM PART-B CRITICAL
18BCE2182 ASSESS_2 Q1
18BCE2182 ASSESS_1 Q2-2
Array Practice
150115_EsMatrizOrdenada