# EZ Math Movie, Tutorials, Decisions, Nested If Statements

### Nested means one within another.

Within the true block of an if statement, or within the true or false block of an if, else statement you can place other if or if, else statements. Such statements are said to be nested. Here is an example that shows how nested if and if, else statements look. The following code will decide what variable, a, b, or c, holds the greatest value. Assume all three variables hold different numbers.

```if(a > b)
{
if(a > c)
{
print('a is the greatest.');
}
}
else
{
if(b > c)
{
print('b is the greatest.);
}
else
{
print('c is the greatest.);
}
}
```

### Running the example program

This program is simply meant to show how one if, else statement can be placed within the true or false block of another. It is not realy meant to do anything practical.

Understand that the simpler if statement can be nested, and if and if, else statements can be nested within each other.

### The example program

0ptions

Go on input

Bounds:
Sorry, apparently this browser does not support HTML 5 canvas tag graphics.
Printer

Edit: Runtime          View: Starter Suggestion

To runtime:

Storage:

Editor width: Normal Wide

### And....

Next tutorial: And and or

### Other sites you may find interesting

Like Math and Physics?

Zona Land Education offers explanations, diagrams, and animations on these topics.
And it is all presented in a clear and casual manner.

Want to learn about programing computers?

EZ Programing Demos has an animated, slow motion, interactive programing language demonstrator.
The site presents basic ideas at a beginner's level.

Custom Search

Name:
Domain:

Name
0

Name:
Name
0