Trying to figure out why my code isn't working


#1

Tries to put the condition b >= a in the for loop, like this:

for (a = 1; a * a < A; a++) {
    for (b = 1; (b * b < A) && **(b >= a)**; b++) {
        if (a * a + b * b == A) {
            *len1 = *len1 + 1;    
        }
    }
}

And the code fails,
Couldn’t understand why


#2

Did you do the same in the second group of loops as well ?