#include <iostream>
#include <vector>
using namespace std;
int main() {
const int NUM_GUESSES = 3;
vector<int> userGuesses(NUM_GUESSES);
unsigned int i;
/* Your solution goes here */
for (i = 0; i < userGuesses.size(); ++i) {
cout << "Enter number " << i << ": ";
cin >> userGuesses.at(i);
}
for (i = 0; i < userGuesses.size(); ++i) {
cout << userGuesses.at(i) << " ";
}
return 0;
}
While a given condition is true, an action is repeated in a for loop. When the condition ultimately evaluates to false, the action is stopped from being repeated. The for loop in JavaScript resembles the for loop in C and Java fairly closely. The most fundamental for loops in JavaScript have the appearance. The for keyword is used at the beginning of this kind of loop, followed by a series of parentheses. They each contain three optional expression statements that are separated by a semicolon,;. The code block statement that needs to be executed is enclosed by a set of curly brackets, or.
Learn more about Java script here:
brainly.com/question/27683282
#SPJ4