Please write me a program to print the first 50 prime
numbers (NOT between the range 1 -50)
Answer Posted / pirya
#include<stdio.h>
#include<conio.h>
void main()
{
int count==0,n=0,i=1,j=1;
clrscr();
while(n<50)
{
j=1;
count=0;
while(j<=1)
{
if(count%i==0)
count++;
j++;
}
if(count==2)
{
printf("%d ",i);
n++;
}
i++;
}
getch();
}
| Is This Answer Correct ? | 13 Yes | 15 No |
Post New Answer View All Answers
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
What is the difference between procedural and functional programming?
What is the difference between Printf(..) and sprint(...) ?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
How do you define structure?
What is void main ()?
What is the value of uninitialized variable in c?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
Why do we write return 0 in c?
What does c mean before a date?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
Why n++ execute faster than n+1 ?
What is static and auto variables in c?
What is the use of f in c?
What is wrong with this program statement?