C++ Coding Practice
Practice typing real code syntax, including brackets, punctuation, and indentation. Snippets are for typing practice only and are never executed.
Loops and conditions
Type the code exactly. Tab inserts four spaces. Code is not executed.
Progress: 0%
Current mismatches: 0
#include <iostream>
#include <vector>
int main() {
std::vector<int> numbers = {3, 8, 12, 5, 10};
for (int number : numbers) {
if (number % 2 == 0) {
std::cout << number << '\n';
}
}
return 0;
}
Type the code exactly, including spaces and indentation.