Loops in C++
What is a Loop?
Loops are used to repeat a block of code multiple times.
Types of Loops
- for loop
- while loop
- do-while loop
Example (for loop)
for(int i = 1; i <= 5; i++) {
cout << i;
}
cout << i;
}
Use Case
Repeating tasks like printing numbers, processing data
