write a program to accept the marks of a student in Maths Science and computer and find the total and average mark display the result
Answers
Answered by
1
//java program
import java.util.Scanner;
class Marks
{
int mmat,msci,mcom;//marks
static Scanner sc=new Scanner(System.in);
public static void main(String args[])
{
System.out.println("Enter marks in maths and science and computer respectively:");
mmat=sc.nextInt();
msc= sc.nextInt();
mcom=sc.nextInt();
int tot=(mmat+msci+mcom);
double a=tot/3;
System.out.println("Total marks:"+tot);
System.out.println("Average marks:"+a);
}
}
Similar questions