Loops (for / while)
Definite repetition with for and conditional repetition with while.
Simple enough for a 5-year-old to understand
for loop
#include <iostream>using namespace std;int main() { for (int i = 1; i <= 3; i++) { cout << i << endl; } return 0;}🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)
🎯 Expected output: 1
2
3
4
5