Skip to content

Instantly share code, notes, and snippets.

@SeanPlusPlus
Created April 20, 2011 02:04
Show Gist options
  • Save SeanPlusPlus/930202 to your computer and use it in GitHub Desktop.
Save SeanPlusPlus/930202 to your computer and use it in GitHub Desktop.
Loop With Prefix
#include <iostream>
using namespace std;
int main()
{
int TOTAL = 9;
for ( int i = 0 ; i < TOTAL ; ++i )
{
cout << "i: " << i << endl;
}
return 0;
}
/* SAMPLE OUTPUT:
*
* i: 0
* i: 1
* i: 2
* i: 3
* i: 4
* i: 5
* i: 6
* i: 7
* i: 8
*
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment