0

Help

#include <iostream> using namespace std; int main(){ int a, b, c, d, e; float rata, jum; cout << "Input value a : "; cin >> a; cout << "Hasil : " << a * a + a <<endl; cout << "Input value b : "; cin >> b; cout << "Hasil : " << b * b + b <<endl; cout << "Input value c : "; cin >> c; cout << "Hasil : " << c * c + c <<endl; cout << "Input value d :"; cin >> d; cout << "Hasil : " << d * d + d <<endl; cout << "Input value e : "; cin >> e; cout << "Hasil : " << e * e + e <<endl; return 0; } My question is : I have five values. but I am confused about the next step to calculate the total number of the five values ​​and calculate the average of the five values

3rd Apr 2021, 9:24 PM
guesttt staarrr__
guesttt staarrr__ - avatar
1 Answer
0
To calculate the average of values add them together and divide them with the amount of numbers: float average = (a + b + c + d + e) / 5;
3rd Apr 2021, 9:49 PM
Julian Bents
Julian Bents - avatar