write a program in Java to accept the computer marks of a student and check whether the student has passed or failed
Answers
Answered by
4
Explanation:
import java.util.*;
class Check_Marks
{
public static void main (String args[ ] )
{
Scanner ym =new Scanner (System.in);
int compmarks, PASSING_MARKS=33, result;
System.out.println("Enter Marks:");
compmarks=ym.nextInt();
result=(compmarks>=PASSING_MARKS)?System.out.println("Passed"); : System.out.println("Failed");
}
}
using ternary operator
Similar questions