•
Example
for (i=0;i<10;i++)
a[i]=b[i]; // copy elements from an array to another array
→
while statement
•
Syntax
while
(
condition-expression)
statement;
•
Description
The while statement is another kind of loop. When the condition-ex-
pression is nonzero, the while loop executes a statement or block of
statements. The condition-expression is checked prior to each execu-
tion of the statement.
•
Example
i=0;
while (b[i] !=0)
{
a[i]=b[i];
i++;
}
→
do-while statement
•
Syntax
do
statement;
while
(
condition-expression);
•
Description
The do-while statement is another kind of while loop. The statement is
always executed before the condition-expression is evaluated. Hence, the
statement executes at least once, then checks the condition-expression.
•
Example
i=0;
do
{
a[i]=b[i];
i++;
}while (i<10);
→
break and continue statement
•
Syntax
break;
continue;
•
Description
The break statement is used to force an immediate exit from while, for,
do-while loops and switch. The break statement bypasses normal
HT-IDE User’s Guide
96
Содержание HT-IDE
Страница 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Страница 12: ...HT IDE User s Guide 2 ...
Страница 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Страница 24: ...HT IDE User s Guide 14 ...
Страница 70: ...HT IDE User s Guide 60 ...
Страница 76: ...HT IDE User s Guide 66 ...
Страница 92: ...HT IDE User s Guide 82 ...
Страница 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Страница 94: ...HT IDE User s Guide 84 ...
Страница 148: ...HT IDE User s Guide 138 ...
Страница 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Страница 154: ...HT IDE User s Guide 144 ...
Страница 192: ...HT IDE User s Guide 182 ...
Страница 194: ...HT IDE User s Guide 184 ...
Страница 218: ...HT IDE User s Guide 208 ...
Страница 235: ...P a r t V Appendix Part V Appendix 225 ...
Страница 236: ...HT IDE User s Guide 226 ...
Страница 250: ...HT IDE User s Guide 240 ...