0

Why output is 60 if i won't to divide the root on 10? I won't to divide any numbers while it isn't 1. How can i do it?

#include <iostream> using namespace std; int main() { float root = 60; for(float root; root !=1; root /= 10) { } cout << root << endl; return 0; }

14th Nov 2018, 8:17 PM
Igor The Golden Fish
Igor The Golden Fish - avatar
1 Odpowiedź
+ 2
Dont declare another root in for else it will be divided by 10. Futhermore, warn that you can trap in an infinute loop
14th Nov 2018, 8:30 PM
KrOW
KrOW - avatar