// Program file: testmath.cpp // This program provides math examples #include #include using namespace std; int main() { int int1, int2; float float1, float2; int1 = 17; int2 = 5; float1 = 12.23; float2 = 3.14; system("cls"); cout << "17 / 5 = " << int1/int2 << endl; cout << "17 % 5 = " << int1%int2 << endl; cout << "17 / 5.0 = " << int1/5.0 << endl; cout << "17.0 / 5 = " << 17.0/int2 << endl; cout << "12.34 / 3.14 = " << float1/float2 << endl; cout << "int(12.23) % int(3.14) = " << int(float1)%int(float2) << endl; cout << "17 / float(5) = " << int1/float(int2) << endl; cout << "float(17/5) = " << float(int1/int2) << endl; system("pause"); return 0; }