answersLogoWhite

0

#include <stdio.h>

int main () {

int n, i, j, k;

printf ("2 ");

for (i=3,n=2; n<=50; i+=2) {

for (j=3,k=1; j<i-1; j+=2) {

if (i % j 1) {

printf ("%d ", i);

n++;

}

}

printf("\n");

return 0;

}

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

ReneRene
Change my mind. I dare you.
Chat with Rene
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi

Add your answer:

Earn +20 pts
Q: C program to generate the first 50 prime number?
Write your answer...
Submit
Still have questions?
magnify glass
imp