// pgm1 -- data, variables, expressions // 8/31/16 #include using namespace std; int main() { // variable definition int pgmNumber=1; // initialized to 1 cout << "This is program number " << pgmNumber << "." << " Have a nice day!" << endl; // expression: legal combination of variables, literals, // and operators cout << "Tomorrow I will write program number " << pgmNumber+1 << "." << endl; cout << "pgmNumber still has the value of : " << pgmNumber << endl; // now we are going change the value of pgmNumber // assignment operator places what is on the right // into the variable on the left pgmNumber=2; cout << "Value of pgmNumber after assignment is: " << pgmNumber << endl; // 2=x; NO GOOD lvalue required int x; x = pgmNumber + 100; // x+2=pgmNumber+100; NO GOOD lvalue required return 0; }