Write a program to print all the prime numbers from 1 to 500. (A prime number is one which is divisible by 1 or itself)
Here is the c source code/program for: Write a program to print all the prime numbers from 1 to 500. (A prime number is one which is divisible by 1 or itself)
/* a program to print all prime number from 1 too 500
programmed by:
Name: Jitendra Kumar Yadav
Roll: 16
Dtae: 12 feb 2011 */
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j;
for(i=2; i<=500; i++)
{
for(j=2; j<i; j++)
{
if(i%j==0)
{
break;
}
}
if (i==j)
printf(“%d\t”,i);
}
getch();
}








