1-100 prime numbers:



main()
{
    int r,c,k;
    clrscr();

    for (r=1; r<=100; r++)
    {
        k=0;
        for(c=2;c<=r-1;c++)
        {
            if(r%c==0)
            {
                k=1;
            }
        }
        if(k==0)
        { 
            printf(“\n %d”,c);
        }
    }
getch();
}           

Output: