Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
18BCE2182 ASSESS_2 Q1
//gcc 7.4.0 #include <stdio.h> #include <stdlib.h> #include <omp.h> int main(int argc, char* argv[]) { int count, cp, i, j; cp=0; int arr[10]; for(i=0; i<10; i++) { arr[i]=rand(); } count=0; #pragma omp parallel #pragma omp sections { #pragma omp section { for(i=0; i<10; i++) { for(j=1; j<=arr[i]; j++) { if(arr[i]%j==0) { count++; } } count=0; if(count==2) { cp++; printf("Prime Number: %d\n",arr[i]); } } } } #pragma omp master { printf("Number of Prime Numbers: %d",cp); } return 0; }
run
|
edit
|
history
|
help
0
++i vs i++
cstructVector
C_141113_euclides
recurtion
b=1 c=1
ALPAHABET PATTERNS
Spring 2017 Project 2 v1.2
pllkkj
Character testing
MatrixMul_shortxshort