#include <iostream>
using namespace std;

int main()
{  int total;
      /* Uninitialized variable, should be set to 0 */
   int x1;
   cout << "Please enter a number: ";
   cin >> x1;
   total = total + x1;
   cout << "Please enter another number: ";        
   cin >> x2;       
   total = total + x1; 
      /* should be x2 not x1 */      
   double average = total / 2;
      /* this is an integer division; should divide by 2.0 or define total to be a double */
   cout << "The average of the two numbers is " 
      << average << "\n";               
   return 0;
}