Relative Content

Tag Archive for c++while-loopsqrt

Using sqrt function within a while loop, don’t understand it

I’m currently going through “C++ Without Fear, Third Edition”. I’m a little confused with this block of code, I understand how the if statement is used to find out if n is divisible by i. I just don’t understand what is the point of the while loop.

c++ sqrt function within a while loop, don’t understand it

I’m currently going through “C++ Without Fear, Third Edition”. I’m a little confused with this block of code, I understand how the if statement is used to find out if n is divisible by i. I just don’t understand what is the point of the while loop.