COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
checkpoint3.9.cpp File Reference
#include <iostream>
Include dependency graph for checkpoint3.9.cpp:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( void )

Definition at line 21 of file checkpoint3.9.cpp.

21 {
22 double values, inputs; int count = 0;
23 while (true){
24 cin >> inputs;
25 if (inputs == -1){
26 break;
27 }
28 else {
29 values += inputs;
30 count += 1;
31 }
32 }
33 if (count){
34 cout << values/count;
35 }
36 return 0;
37}