What can i do here to get the result and the remainder to? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What can i do here to get the result and the remainder to?

#include <iostream> using namespace std; int main() { float x = 10 / 3; cout << x; return 0; }

28th Mar 2017, 3:34 PM
Ionut /
Ionut / - avatar
1 Answer
+ 4
float x = 14.0 / 4; // x is 3.5 int y = int(14/4); //y is 3 int r = 14 % 4; // r is 2
28th Mar 2017, 3:53 PM
Tob
Tob - avatar