Write a program in java to input marks in three subjects score by student in M1 M2 M3. Find the average and print the marks
Answers
Explanation:
import java.util.*;
{
public static void main (String ar [])
{
Scanner Sc=new Scanner (System.in);
int M1,M2,M3;
double avg=0.0;
System.out.println("Enter 3 sub marks");
M1=Sc.nextInt();
M2=Sc.nextInt();
M3=Sc.nextInt();
avg=(M1+M2+M3)/3
System.out.println(avg);
}
}
Answer:
Java Program To Calculate Average Marks | 5 Methods
Java program to calculate the average of marks. Here we cover five simple ways to find out the average of marks in Java programming. If you know the basics of coding, you can even write more than 5+ ways. However, as a newbie, we share the program in 5 different ways. Do check it out. Our database consists of more than 100+ sample Java programs. The following program is written in five simple ways: standard values, class, by using method, by using command line arguments.
Table Of Contents:
Java Program To Calculate Future Investment Value
Volume Of Cube Java Program – 2 Ways | Programs
So, How to calculate the average of marks in math?
A: That’s quite simple, for example, consider you have just completed your sem exams, and the result announced as:
Maths – 75
Science – 55
Operating Systems – 80
Dataware house – 75
Now, sum up all – 285/4 = 71.25 ( Your average marks )
So, your average of entire subjects are = 71.25 ( Formula stated below)
java program for average of marks
That’s a standard and the only way to calculate your average of marks. Now, check out the following programs.
Explanation:
5o tnanks =inbox