Advertisement
Advertisement
//Java - if statement program
public class A
{
public static void main(String... ar)
{
if(100>5)
System.out.println("100 is greater than 5");
if(50<100)
{
System.out.println("50 is less than 100");
System.out.println("Second statement to execute");
}
if(2>4)
{
System.out.println("2 is greater than 4");
}
//This statement associated with any if block
System.out.println("Statement outside If Statement");
}
}
100 is greater than 5
50 is less than 100
Second statement to execute
Statement outside If Statement
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement