// // Program name: add_v1 // Author: B. Massingill // // Input: none // Output: sum and average of x, y written to standard output // (x = 10, y = 20) // // C++ programs begin with the following three lines #include int main() { //declare two integers int x; int y; //assign values x = 10; y = 20; //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; }