Saturday, January 8, 2011

Bit Operation #9

Print out odd numbers from 1 to 100

void printOddNumber()
{
    for (int i = 1; i <= 100; ++i)
    {
        if (i & 0x01)
            cout << i << \n;
    }
}

No comments: