Counting With a Prefix Increment
Mississippi College
Computer Science
Dr. Bennet
CSC 220
Introduction
First Steps
C Note
Control
While Loop
For Loop
Switch Statement
Do-While
For Each Loop
Break Statement
Continue Statement
Bool Conversion
Increment Ops
Count Test I
Count Test II
Prefix Count
Count Test III
While Again
Total Change
Test Error
C Note
Functions
Exceptions
Containers
Native Arrays
Classes
Templates
Dynamic Memory
Copying Objects
Class Inheritance
Multi-File Programs
Other Things
#include <iostream> using namespace std; // Counting loop example. int main() { int cnt; cout << "How many? "; cin >> cnt; while(--cnt) cout << "cnt = " << cnt << endl; }
[download]
How does this verion behave differently?