Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Prime no in given array
#include <stdio.h> int main() { int arr[20],size,p,i,j; scanf("%d",&size); for(i=0;i<size;i++) { scanf("%d",&arr[i]); } //all prime numbers for(i=0;i<size;i++) { j=2; p=1; while(j<arr[i]){ if (arr[i]%j==0){ p=0; break; } j++; } if(p==1){ printf("%d ",arr[i]); } } return 0; }
run
|
edit
|
history
|
help
0
Hello
ques.1
test
Stub Program for Problem 5 HW 2
DIGITOS DE U. A DECENAS
Difference between memcpy n strncpy
Primes in binary
Lab 11v0.6
Star pattern
18BCE2182 ASSESS_2 Q1