GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


Prime number test by DELTRON
bool isprime(int n)
{
    float a=n;
    int x=1, c=(int)(sqrt(a));
    while (x++)
    {
        if (x>c) return true;
        if (!((a/x)>(int)(a/x))) return false;
    }
}