If Else Statement in Java

Get Into Code provides you with free C++ and Java Course in Hindi/Urdu and also provides you the opportunity to practice your skills to be perfect. In the previous video we have discussed about the Relational Operators in Java. In this video we are going to discuss about If Else Statement in Java.
If Esle Statement
If Else Statement is modified form of If Statement. This Statement is used to make Decision when there is two possible answers. For Instance, Student can either Pass or Fail in examination. In this Statement, if Condition is true then the Body of if will be executed. And if the condition is false then the body of else will be executed.
Syntax
if (Marks => 40){
System.out.println("You are Pass");
}
else{
System.out.println("You are Fail");
}

Watch The Video Below to Understand If Else Statement in Java


The best about our site is that we provide our readers to practice their skills because Practice Puts Brain in Your Muscles. So, Go Ahead and Write a Java Program to check whether Student is pass or fail using If Else Statement. ( Student have to take 40 out of 100 marks to pass.)
Respected output will be as
Enter Your Obtained Marks
35
Sorry, You are Fail.

No comments

Powered by Blogger.