Ask Question
10 March, 21:26

Subana is writing a program which will calculate the mean average of a set of numbers by adding the numbers and dividing the result by the amount of numbers. She will use a variable, avg, to store this average. Which variable type would be most suitable for avg?

+4
Answers (1)
  1. 10 March, 21:59
    0
    a variable of type "double" is more suitable for finding average because average could be any number with decimal places. we can't use a variable of type "integer" because it will omit the value after the decimal and will not produce satisfactory results.

    Explanation:

    an example of C+ + code is given to find the average of two numbers a and b

    #include;

    using namespace std;

    int main () {

    double a = 2.334;

    double b = 34;

    double average = (a + b) / 2;

    cout << average;

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Subana is writing a program which will calculate the mean average of a set of numbers by adding the numbers and dividing the result by the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers