Hey, I was doing the run-time errors lesson where we have to fix this:
#include <iostream>
int main() {
int width = 20;
int length = 0;
int ratio = width / length;
std::cout << ratio << "\n";
}
Changed it to this:
#include <iostream>
int main() {
int width = 20;
int length = 30;
int ratio = width / length;
std::cout << ratio << "\n";
}
It works fine, but the answer gives me 0, which is supposed to be 0.6666…
I changes int ratio to double ratio, same thing. Anyone knows? Thanks.