Notes - 1.27 - – E E 312 Notes 1 27 For Loops For...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: – . E E 312 Notes 1 27 For Loops- ( ; ; ) For expression 1 expression 2 expression 3 statement- : Ex ( = ; > ; --) for i 10 I 0 i o Printf (“ % ”, ) T Minus d and counting\n i- , , I is at 10 check if I is greater than zero then decrement I and go back and check to see if it is still zero- Any of the expression may be omitted Nested Loops- , ; Int I num- ( = ; <= ; ++){ For i 1 i 5 i o ( = ; < ; ++){ For num 0 num I num (“% “, * + ); Printf d num 2 1- }- (“ ”); Print \n- }- Break exits you out of loops- Continue allows you to stay in your loop o Will go back to check the previous conditions- Do While Statement- ( ) Do statement while expression- Expression is evaluated after each execution of the loop and the . loop body is always done at least once Comma Operator- Allows to put multiple expressions where c expects only one expressions- , General form is expr1 expr2 Null Statement- Its just a semicolon- Means null statement- : Good for one thing writing loops whose bodies are empty...
View Full Document

{[ snackBarMessage ]}

Page1 / 5

Notes - 1.27 - – E E 312 Notes 1 27 For Loops For...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online