C-Program to print all prime numbers from 1 to 300.        

#include<stdio.h>
#include<conio.h>
void main()
{
int gno,count,i=2,p;
clrscr();
printf("Series of prime numbers form 1 to 300 is : 1 ");
for(count=2;count<=300;count++)
  {
   p=0;
   gno=count;
   i=2;
do
  {
     if(gno%i==0)
     p=1;
 i++;
   }while(i<gno);
if(gno==2 || p==0)
        printf("\t%d",gno);
  }
getch();
}