Week09 - ENEE 140 Introduction to Programming Concepts for...

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

View Full Document Right Arrow Icon
ENEE 140: Introduction to Programming Concepts for Engineers [email protected] © Gang Qu Spring 2010 Week 9 No lab report due this week. Quiz 2 on Wednesday Midterm on Friday Lab 15: Monday April 5 1. while loop and do-while loop: while (expression) do { statements; { statements; } } while(expression); new_statements; new_statements; Program flow of while loop: expression – statements – expression – statements – … - expression - new_statements. All the expression valuate at true except the last one. Program flow for do-while loop: statements – expression – statements – expression – … - expression - new_statements. All the expression valuate at true except the last one. 2. break: command for early termination of a loop Question 1: What will be the output of the following code segment? Trace the value of each variable after each statement in the program, then copy the code to a file and make it a complete program, compile the program and execute it to check your answer. int i = 1, j = 2, k = 10;
Background image of page 1

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

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

{[ snackBarMessage ]}

Page1 / 2

Week09 - ENEE 140 Introduction to Programming Concepts for...

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

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