LO: (Apply] Students will write loops that iterate over every value in a range. Some marathon organizers are advertising the distances of their races using kilometers. Help them explain the races to participants who are unfamiliar with the metric system. Print a line for each length of race that explains approximately how long it is in miles. The races are organized in increments of 5km. There is a 5km, a 10km, and so on, all the way up to a 40km race. There are approximately 0.621 miles in a kilometer. Miles should be rounded to the nearest whole number. Follow this format: A Skm race is approximately 3 miles long. maln.cpp O O New X Full Screen 1 #include using namespace std; * Displays how long each race is in kilometers and miles. 6. */ 7- int main() { 8 10 11 return 0; 12 } 13
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.

![LO: (Analyze) Students will choose the type of loop best suited to the task.
LO: (Remember)] Students will locate the start, stop. and step parameters of a loop.
Write a program that counts by 19s from 615 to 900 (inclusive). Print each number.
maln.cpp O
1 #include <iostream>
2 using namespace std;
New
4- /*
* Counts by 195 from 615 to 900.
*/
7- int main() {
8
10
return 0;
11 }](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3ded9074-643d-40d8-825c-f0dff7af7ebf%2F14be521e-5280-4d73-bbf4-78c4494af16b%2Fc344t6_processed.png&w=3840&q=75)

Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 2 images









