
Chapter 3: Prelab Assignment
Numeric Types, Expressions, and Output | 51
Name __________________________________________ Date _______________________
Section _________________________________________
Examine the following program carefully and answer the question in Exercise 1.
// Program Pres demonstrates the precedence of operators.
#include <iostream>
using namespace std;
int main ()
{
cout << fixed << showpoint;
cout << 4 + 3 * 5 << endl;
cout << (4 + 3) * 5 <<endl;
cout << 4 * 5 % 3 + 2 << endl;
cout << (4 * (5 / 3) + 2) << endl;
return 0;
}
Exercise 1: Show what is written by each of the output statements.
78828_CH03_DaleLab 5/22/09 1:49 PM Page 51