Ask Question
29 January, 08:54

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?

+3
Answers (1)
  1. 29 January, 11:54
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers