Checkpoint 6.5.1.
What is a good name for the variable x, found in the code block below?
#include <iostream>
using namespace std;
int main() {
int x = 1;
while (x <= 6) {
cout << 3 * x << " ";
x = x + 1;
}
cout << endl;
return 0;
}
- counter
- Try again!
- loop variable
- Try again!
- Both a and b
- Correct!
- None of the above
- Try again!