- 1
Input the amount of sales for 12 months of a medical representative and find the average sales value without using an array.
please... can you do???
4 ответов
0
assuming you don't need the monthly values for further calculations. This would do
int x=0, sum=0, avg=0, input=0;
while(x<12)
{
cin >> input;
sum += input;
x++;
}
avg = sum / 12;
cout << "average is:" << avg << endl;
0
thanks
0
if you have to print the decimal digits as well.
you should define avg as float.
0
mm