Back to: Java Program’s
public class Average_of_five_number { public static void main(String args[]) { int numberone = 20; int numbertwo = 30; int numberthree = 12; int numberfour = 10; int numberfive = 18; int a = (numberone + numbertwo + numberthree + numberfour + numberfive) / 5; System.out.println("The numberthree is 12"); System.out.println("The numberone is 20"); System.out.println("The numbertwo is 30"); System.out.println("The numberfour is 10"); System.out.println("The numberfive is 18"); System.out.println("The average is" + a); } }
Submitted By: Ms. Zarin Shroff
If this program was helpful to you, do leave a comment.
All Creadit goes to Ms. Zarin Shroff
P.N. : All the post on this website are for demonstration and education purpose only.
Student should perform all the practicals for there personal copies.
Easy to understand it
In line17 it will be %5 not 2
In line 17 it shld be % 5 not 2
Thank you Snehi Palviya for correction.