Prime numbers Upto 500.

#include<stdio.h>
#include<conio.h>
void main()
{
    int i,j,k;
    clrscr();
    for(i=3;i<500;i++)
    {
        for(j=2;j<i;j++)
        {
            k=0;
            if(i%j==0)
            {
            k=1;
            break;
            }
        }
        if(k==0)
        printf("%4d",i);
    }
    getch();


}

Comments

Popular posts from this blog

Maggi Chicken Noodles