Computer Science, asked by Keerthi0215, 1 year ago

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?
Keerthi0215: yes
neelbhatkar3: ok
neelbhatkar3: if there is anything wrong with the if conditions make changes where i hv underlined,if not ignore the underline. :)

Answers

Answered by neelbhatkar3
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