4.6k views
4 votes
What will this program print if the value of grade is 80?

if(grade > 90)
{
System.out.println("A");
}
else if(grade > 80)
{
System.out.println("B");
}
else if(grade > 70)
{
System.out.println("C");
}


A


B


C


Nothing

User Jbeck
by
4.3k points

1 Answer

5 votes

Answer: C

Step-by-step explanation: The if statement shows that if the grade is higher than 80 then print "B". If the grade is exactly eighty. It will trigger C since it checks if 80 is higher than 80, since 80 is in fact not higher than 80 the statement will return false putting it to the next if statement printing "C".

User Avrsanjay
by
4.3k points