Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class Homework NotesHomework Notes –Always try to match the printed output if I give.

Similar presentations


Presentation on theme: "March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class Homework NotesHomework Notes –Always try to match the printed output if I give."— Presentation transcript:

1 March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class Homework NotesHomework Notes –Always try to match the printed output if I give one –Order is more important that textual formatting –Correct numerical results are more important that text format Nested For loopsNested For loops Do loopsDo loops Revisit the Average exampleRevisit the Average example Integer SizesInteger Sizes Lab 6: Compare Integer SizesLab 6: Compare Integer Sizes

2 March 2005 2R. Smith - University of St Thomas - Minnesota Nested For Loops What makes a For loop work?What makes a For loop work? Mixing two loops togetherMixing two loops together Multiplication table exampleMultiplication table example

3 March 2005 3R. Smith - University of St Thomas - Minnesota Do Loops The opposite case of the While loopThe opposite case of the While loop Test at the END of the loopTest at the END of the loop Flow chartFlow chart Leading vs Trailing DecisionsLeading vs Trailing Decisions

4 March 2005 4R. Smith - University of St Thomas - Minnesota Example: Size of Integers char, short, int, long, long longchar, short, int, long, long long Why different sizes?Why different sizes? What is factorial?What is factorial? Factorial example with DOFactorial example with DO

5 March 2005 5R. Smith - University of St Thomas - Minnesota Lab 6 Send me the.c file that computers ONE of your factorialsSend me the.c file that computers ONE of your factorials Give me a list of values of “i” that cause overflows to negativeGive me a list of values of “i” that cause overflows to negative –One value for each size of integer: char, short, int, long, long long. Extra creditExtra credit –Do it for ‘unsigned’ short, int, long, long long –Send me the.C file for this, too

6 March 2005 6R. Smith - University of St Thomas - Minnesota Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by- sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.


Download ppt "March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class Homework NotesHomework Notes –Always try to match the printed output if I give."

Similar presentations


Ads by Google