write a program to accept three subject marks and then calculate average.if average is equal to or more than 70.find whether 1st class or just pass
neelbhatkar3:
in JAVA?
Answers
Answered by
1
import java.util.*;
public class brainlymarks
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int o,s,t;
double avg;
System.out.println("write the marks for first subject");
o=sc.nextInt();
System.out.println("write the marks for second subject");
s=sc.nextInt();
System.out.println("write the marks for 3rd subject");
t=sc.nextInt();
avg=(o+s+t)/3;
System.out.println("average score="+avg);
if(avg>=75)
System.out.println("FIRST CLASS");
if(avg<75)
System.out.println("JUST PASS");
}
}
Similar questions