12:21 am - Tuesday May 22, 2018

Java Example Program to find the Average of Marks

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
*@author:Candidjava.com
*@Discription: collact the student marks and find the average of marks
*/
public class Avg {
	public static void main(String[] args) {
		int n = 5;
		int marks[] = { 50, 62, 75, 63, 92 };// student marks
		int avg;
		avg = (50 + 62 + 75 + 63 + 92) / n;// find the Average
		System.out.println("avg:" + avg);// display the value of Average
	}
}


Output:

Avg:68

Filed in: Sample Programs in java

Comments are closed.