MeehoweCK

Untitled

Oct 23rd, 2020
700
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int number, sum;
  8.     double counter = 0;
  9.  
  10.     cout << "Please enter intiger numbers (0 finishes): ";
  11.  
  12.     cin >> number;
  13.     sum = number;
  14.  
  15.     while(number != 0)
  16.     {
  17.         cin >> number;
  18.         sum = sum + number;
  19.         ++counter;
  20.     }
  21.  
  22.     cout << "The average of the numbers you typed is " << sum / counter << endl;
  23.  
  24.     return 0;
  25. }
RAW Paste Data