Print all the prime numbers which are below the given number separated by comma.
Input: 50
#include"stdio.h" int main() { int n,i,j,ct=0; scanf(%d,&n); for(i=2;i<=n;i++) { ct=0; for(j=2;j<i;j++) { if(i%j==0) { ct=1; break; } } if(ct==0) { if(i>2) printf(, ); printf(%d,i); } } return 0; }
Answers
Answered by
0
Answer:
can't understand the question?
Similar questions
English,
1 month ago
English,
1 month ago
Math,
1 month ago
Math,
2 months ago
Computer Science,
9 months ago