Lab Assignment 2

1. Write hello_world program as discussed in class

2. Write a program to initialize five variables and compute the following expression and print it on the console.

double c = 100;
double f = 9/5 * c + 32;
print f using cout
What is the answer?
What do you think is the result of the division? Why?
What is you change 9 to 9.0? Does the result change? why or why not?
What is the order of evaluation? Can you guess the precedence rules for the order of evaluation?

What is the result if you write the code as the following:
double c = 100;
double d = 9;
double f = d/5 * c + 32;

What about:
double c = 100;
int d = 9;
double f = d/5 * c + 32;