// The first step is to fill the array with random numbers
    // (from 1 to 100)


    for (ctr = 0; ctr < 10; ctr++)
    {
        nums[ctr] = (rand() % 99) + 1;
    }

이러면 from 1 to 99아닌가..