If else Statement in java, pass or fail.

Java Programming Language Decision Making in java (Article) Decision Making in java (Program)

77919

Program:

 class Ifelse {
    public static void main(String[] args) {

        int marks = 76;
        String grade;

        if (marks >= 40) {
            grade = "Pass";
        }
        else
        {
            grade = "Fail";
        }

        System.out.println("Grade = " + grade);
    }
}

Output:

Grade = Pass
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.