C++
ENGR 2230 – ENGINEERING PROGRAMMING
Homework #1 Part I Due – February 3, 2015
Print Your Name Here
All homework assignments must be submitted on time and in class only.
Write a program that declares and initializes three integer variables to 35, 67, and 452, and output their sum and their product.
|
#include <iostream> using namespace std; int main() { } |
ENGR 2230 – ENGINEERING PROGRAMMING
Homework #1 Part II Due – February 3, 2015
Print Your Name Here
Give the output generated by the following statement
cout << "Welcome to " << endl
<< "ENGR 2230";
Write a single C++ statement to accomplish each of the following (assume all the variables have been declared)
Declare two integer variables x and z and initialize them to 1 and -1, respectively.
Convert the following mathematical formula into C++ expression.
3
6
3
2
+
-
+
=
x
x
x
y
State the order of evaluation of the operators x=8%3-4+9/3 and determine the value of x