The if Statement

syntax: if(condition) statement;

if condition is true statement will run otherwise bypassed.

example:if(x>10) system.out.println("x is greater than 10");

  • operators

    <,>,==,>=,<=

The for Loop

syntax: for(initialization; condition; iteration) statement;

initialization - initializes a value to a variable which controls for loop.

condition- is a boolean expression that tests the loop control
variable. If it is true, the for loop continues to iterate. If it is false,
the loop terminates.

iteration- is a expression which changes the loop variable when condition is true.

example : for(x = 0; x<10; x++)

results matching ""

    No results matching ""