blob: 63c814af44e7d7435007a5ef9cd8e7dd4bbbd4c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include <iostream>
/*
*
* 4.38
*
*
*/
int main () {
int i = 3;
int j = 10;
double slope = static_cast<double>(j / i); // divide i and j as integers and then cast returned value to double
// double slope = static_cast<double>(j) / i; I suspect that this version of the expression is what we are actually trying to do
std::cout << slope << std::endl;
return 0;
}
|