Created
March 17, 2017 08:55
-
-
Save gpetuhov/4cccdeb0269570b084921e61901a11cc to your computer and use it in GitHub Desktop.
C++ For loop example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() { | |
int NUM_ITERATIONS = 0; //number of iterations | |
int i; | |
int sum = 0; | |
cout << "Enter number of iterations" << endl; | |
cin >> NUM_ITERATIONS; | |
for (i = 0; i < NUM_ITERATIONS; i++) { | |
sum++; | |
} | |
cout << "SUM = " << sum << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment