Ajay scored 92 marks in English, 85 marks in Hindi, and 96 marks in Mathematics. Write a program in Java to calculate the total and average marks scored by Ajay. Print both of them on separate lines with appropriate messages. please tell
Answers
Answered by
2
public class marks
{
public static void main(String args[ ])
{
int english=92, hindi=85, maths=96, sum;
double avg;
sum=english+hindi+maths;
avg=sum/3;
System.out.println("The total marks obtained by Ajay= "+sum);
System.out.println("The average marks scored by Ajay= "+avg);
}
}
Similar questions