Hey, how should i count the average of numbers that were inputed until 0. All the nubers should make their output and then the average. I dont know what to divide the sum with. I know i shoul make one more variable. Thanks!!!
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
usingnamespace std;
int main (){
float a=1,avg=0,sum=0;//a-the number, avg-average
while(a>0){
cin>>a;
sum=a+sum;
}
avg=sum/ ;//???
return 0;
}