All pastes #351526 Raw Edit

Untitled

public text v1 · immutable
·published 2007-02-12 05:59 UTC
rendered paste body
void main()
{
	int primes;
	int i;
	int j;
	int flag;
	flag=0;
	i=0;
	j=2;
	primes=0;
	printf(“\n”)
	printf(“The following is the list of primes from 0 to 999:”)
	for(j=2;j<1000;j++)
	{
		flag=0;
		for(i=2;i<=j/2;i++)
		{
			if(j%i==0)
			{
				flag=1;
		}
		}
		if(flag==0 || i==j)
		{
			primes++;
			printf(“\n”);
			printf(“%d”,j);
		}
	}
	printf(“\n”)
	printf(“The total number of primes between 0 and 999 are: %d”,primes);
}