How to do the Program of average in java | average ka program kise kare.

so in this post we will discuss about How to do the Program of average in java | average ka program kise kare. in detail as per following

Average Program

package logicaltask;

public class Average {
	//Instance Variable
	int n1,n2,n3,n4,n5,n6,sum,div,all;
	//Constructor
	public Average () {
		n1=1204;
		n2=320;
		n3=226;
		n4=1444;
		n5=99999;
		n6=456;
		sum=n1+n2+n3+n4+n5+n6;
		div=6;
	}
	//Non Static Method
	public void non () {
		all=sum/div;
		System.out.println("Your Average Of The Sum Is a " + all);
	}
	//Main method
	public static void main (String [] args) {
		// Creating Object For calling Non Static Method
		Average cap = new Average ();
		cap.non();
	}
}

Average Program

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

7th day of Navratri 10-2-2022 Sanjay Raut: संजय राउत के घर रविवार सुबह पहुंची ED, President Draupadi Murmu Vedanta declares dividend of Rs 19.5 per share CBSE 10th 12th Results 2022-जारी होने वाला है