// // Program name: add_v2 // Author: B. Massingill // // Input: two integers x and y, read from standard input // Output: sum and average of x, y written to standard output // // C++ programs begin with the following three lines #include int main() { //declare two integers int x; int y; //print prompt and get user inputs cout << "Enter two numbers" << endl; cin >> x; cin >> y; //add the integers int sum; sum=x+y; //compute the average int avg; avg=sum/2; //print cout << "The sum is " << sum << endl; cout << "The average is " << avg << endl; // C++ programs end with the following two lines return 0; }