Computer Science, asked by gourav3312, 11 months ago

what instruction would I use if I wanted a loop to execute 10 times

Answers

Answered by shubhamjoshi033
26

The variable used in the loop condition is the number i, which you use to count the integers from 1 to 10. First you initialize this number to 1. In the condition, you check whether i is less than or equal to 10, and if this is true you execute the loop body. Then, at the end of the loop body, you update i by incrementing it by 1.

Here is an example of the program using a while loop,

statement;

i = 1

while i <=10:;

  i += 1

This program will execute the "statement" 10 times.

Answered by vibha9559684214
2

Answer:

the variabel used in the loop conditon is the number i,which you use to count the integers from 1 to 10. First you initialize this number to 1.In the condition,you check whether i is less than or equal to 10,and if is true you execute the loop body,you update i by incrementing by 1.

Here is an example of the program using a while loop,

statement,

i = 1

while i <=10:;

i+=1

thos program will execute the 'statement' 10 times.

Similar questions