| Lexington High School Mathematics | Math Dept. Front Page | Student Links | Family Links |
| Introduction to C++, Kevin Kelly | Kelly Front Page | C++ Course Guide | C++ Assignments | C++ Info |
For this assignment you have to write two short programs, 20A and 20B. Hand in everything at once (two programs, two runs), stapled together.
Program 20A: Write a program that adds the first thousand odd numbers: 1+3+5+7+9+11+... Compare the answer you get with other students' answers.
Program 20B: If you used a for statement in
Program 20A, write a second version of the program
that uses either while or do...while, instead.
If you didn't use for in Program 21A, write a second version of the
program that does use for.