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; }
1 Respuesta
+ 2
Dont declare another root in for else it will be divided by 10. Futhermore, warn that you can trap in an infinute loop