Answers for "how to compute average mean"

C++
1

Compute Average

int a, b, c, d, sum, average;

    cout << "Input the 1st number: ";
    cin >> a;
    cout << "Input the 2nd number: ";
    cin >> b;
    cout << "Input the 3rd number: ";
    cin >> c;
    cout << "Input the 4th number: ";
    cin >> d;

    sum = a+b+c+d;
    average = sum/4;

    cout << "The average is: " << average << endl;
Posted by: Guest on March-04-2022
2

how to calculate average programing

START
   Step 1 → Collect integer values in an array A of size N
   Step 2 → Add all values of A
   Step 3 → Divide the output of Step 2 with N
   Step 4 → Display the output of Step 3 as average
STOP
Posted by: Guest on June-11-2021

Code answers related to "how to compute average mean"

Browse Popular Code Answers by Language