// CS P125 - Lab 3 // Description: This program will compute several mathematical expressions // and output their results. // $Revision: 1.2 $ #include #include using namespace std; int main () { // object definitions and initializations: int a = 3; int b = 12; int c = 6; int d = 1; // Now calculate the results. d = d * a; c = c + (2 * a); d = d - (b / c); c = c * (b % c); b = b / 2; // Finally display the results. cout << "a: " << a << endl; cout << "b: " << b << endl; cout << "c: " << c << endl; cout << "d: " << d << endl; // Exit indicating a lack of errors. return 0; }