# Finding Average in JSP

In mathematics, an average is a measure of the middle of the data set. The average value is the total amount divided by the total number of elements.

Ads

Tutorials
Ads

# Finding Average in JSP

In mathematics, an average is a measure of the middle of the data set. The average value is the total amount divided by the total number of elements.

The code of the program is given below:

 ``` Finding Average in jsp ``` ``` ``` ```

Finding Average in jsp

<% float grades[] = {98, 99, 100, 97, 78, 96}; float sum, average;``` ` sum = 0;` ``` for (int j = 0; j < grades.length; j++) { sum = grades[j] + sum; }``` ` average = sum / grades.length;` ``` out.println("Average grade = " + average); %>
```

Output of the program:

Download this example.

Advertisements

Online Training Classes

Share on Google+

# Finding Average in JSP

Posted on: March 11, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads

Related Tutorials

Discuss: Finding Average in JSP

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):

Comments:0

Ads

Ads