CATEGORII DOCUMENTE |
Asp | Autocad | C | Dot net | Excel | Fox pro | Html | Java |
Linux | Mathcad | Photoshop | Php | Sql | Visual studio | Windows | Xml |
The if-else statement is probably the most basic way to control program flow. The else is optional, so you can use if in two forms:
if(Boolean-expression statement
or
if(Boolean-expression statement
else
statement
The conditional must produce a Boolean result. The statement means either a simple statement terminated by a semicolon or a compound statement, which is a group of simple statements enclosed in braces. Anytime the word "statement" is used, it always implies that the statement can be simple or compound.
As an example of if-else, here is a test( ) method that will tell you whether a guess is above, below, or equivalent to a target number:
static int test(int testval)
It is conventional to indent the body of a control flow statement so the reader might easily determine where it begins and ends.
Politica de confidentialitate | Termeni si conditii de utilizare |
Vizualizari: 705
Importanta:
Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved