Please write me a program to print the first 50 prime
numbers (NOT between the range 1 -50)
Answer Posted / antony
#include<stdio.h>
void main()
{
int count=0;
int num=1;
int i;
printf("prime nums \n");
while(count<50)
{
num++;
for (i=2;i<=num-1;i)
{
if(num%i==0)break;
i++;
}
if(i>=num-1)
{
printf("%d ",num);
count++;
}
}
}
| Is This Answer Correct ? | 93 Yes | 47 No |
Post New Answer View All Answers
What is stack in c?
What is typedf?
What is the mean of function?
Explain data types & how many data types supported by c?
How do I read the arrow keys? What about function keys?
Does sprintf put null character?
What is the correct declaration of main?
Is null equal to 0 in sql?
How can you draw circles in C?
What is sizeof int in c?
Why do we need functions in c?
how to build a exercise findig min number of e heap with list imlemented?
Can a pointer be null?
How can I invoke another program or command and trap its output?
What do you know about the use of bit field?