Write a program to find prime numbers using sieve method.

#include <stdio.h>

#include <conio.h>

int main()

{

int a=0,n,k=2,b;

printf(“Enter the no till u want to find prime no’s: “);

scanf(“%d”,&a);

printf(“Prime Number between 1 to %d \n”,a);

for(n=0;n<a;n++)

{

b=n+1;

for(k=2;b>k;k++)

{

if(b%k==0)

break;

}

if(b==k)

printf(“%d\t”,b);

}

getch();

}