Please I want this code to print out between 10 to 15 prime numbersper line (lik
ID: 3616228 • Letter: P
Question
Please I want this code to print out between 10 to 15 prime numbersper line (like matrix). Thanks#include<stdio.h>
int main(void)
{
int i, n = 1;
int k = 0;
printf("Prime numbersbtw 1 to 300 are: 1 ");
while(n <= 3000)
{
i = 2;
while(i < n)
{
if(n % i == 0)
break;
else
i++;
}
if(i == n)
{
printf("%d ", n);
k++;
}
n++;
}
//printf(" k = %d",k);
}
~
Explanation / Answer
please rate - thanks #include #include int main(void) { int i, n = 1; int k = 1; printf("Prime numbersbtw 1 to 3000 are: 1"); while(nRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.