0
Briefly explain what is wrong with the code.
int x, y; cout << "Enter x and y: "; cin >> x >> y; cout << "product = " << x * y << endl; cout << "ratio = " << x / y << endl; cout << "sum = " << x + y << endl;
2 ответов
+ 4
Well, what does it say? I can't work off of just this, you need to tell us what's the actual problem.
The only thing I can think of here is you're dividing two integers which results in an int, you probably want a fractional result so you should cast one of these to either a float or a double.
0
sarah johnathon
There is nothing wrong. Program is working well.