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


Please Help Members By Posting Answers For Below Questions

What is the difference between break and continue?

943


What is #line?

818


what is the difference between 123 and 0123 in c?

944


What are the key features in c programming language?

823


What is a structure in c language. how to initialise a structure in c?

831


In a byte, what is the maximum decimal number that you can accommodate?

885


What is methods in c?

834


In c programming language, how many parameters can be passed to a function ?

867


How do I get an accurate error status return from system on ms-dos?

871


How can a program be made to print the line number where an error occurs?

873


how to find anagram without using string functions using only loops in c programming

2932


What is the difference between typedef and #define?

728


how can use subset in c program and give more example

1689


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1717


What is the difference between text and binary modes?

874