Home » JAVA Programming » Basic Datatypes » Question
  1. What is the output of this program?

    class Average {
    public static void main(String args[])
    {
    double number[] = {5.5, 10.1, 11, 12.8, 56.9, 2.5};
    double res;
    res = 0;
    for (int i = 0; i < 6; ++i)
    {
    res = res + number[i];
    }
    System.out.print(res/6);

    }
    }
    1. 16.34
    2. 16.566666644
    3. 16.46666666666667
    4. 16.46666666666666
    5. NA
Correct Option: C

Output of this program: 16.46666666666667



Your comments will be displayed only after manual approval.