I need help writing a loop function. I need to use a while loop to find the smallest integer (n) so that n^2 > 12,000.
expl.
109 x 109 = 11881
110 x 110 = 12100
Therefore, 110 is the smallest value where n2 > 12000. But I need to use a loop to find the solution and I'm just not quite sure how to code this. Could someone please help me? Thanks in advance
Just a note that the caret, '^', does not do exponentiation but rather bitwise exclusive or. If you want to do exponentiation, use the pow function in the math library. Or, in the case of n to the power of 2, simply n*n.