Conditional Statement
Conditional Statement
CONDITIONAL
STATEMENTS
ABOUT
CONDITIONAL
STATEMENT
Everyday in our life we make decisions
whether our decisions are good or bad, it
all depends on the conditions that we
make. The same is also true in
programming. We use conditions to make
our programs intelligent enough to give us
the right results when we needed them
most.
IF-ELSE FLOW CHART
1. Test Condition:
• The program first evaluates the given
Test Condition.
2. True Branch:
• If the Test Condition is true, the
program executes the code within the
"Body of if" block.
3. False Branch:
• If the Test Condition is false, the
program executes the code within the
"Body of else" block.
4. Statement:
• Regardless of whether the Test
Condition was true or false, the
"Statement" will always be executed
after the If-Else block is complete.
NESTED IF
STATEMENT
Nested if refers to an if statement within an
if statement. When we write an inner if
condition within an outer if condition, then it
is referred to as a nested if statement in
java.
Nested if is a decision-making statement that
works similar to other decision-making
statements such as if, else, if..else, etc. It
executes a block of code if the condition written
within the if statement is true. However, in the
nested-if statement, the block of code is placed
inside another if block. And the inner block of
code will execute only when the outer condition
holds true.
THANK YOU
www.reallygreatsite.com