I just started taking a class in C++ at school and had a quick nooby question. What happens to the remainders and decimals when you execute simple math? why does 10 / 4 = 2 rather then 2.5?
#include<iostream>
usingnamespace std;
int main()
{
int a = 10.000, b = 4.000;
int c;
double d, e;
double f = 4.00;
char g = 'A';
c = a % b;
d = a / b;
e = a / b;
a = a + d;
b = -d;
g = g + 1;
cout << "C " << c;
cout << "D " << d;
cout << "E " << e;
cout << "A " << a;
cout << "B " << b;
cout << "G " << g;
}