loops there are 3 common ways of performing a


Loops

There are 3 common ways of performing a looping function:

for ... to ... next, while ... endwhile and repeat ... until

The below example input 100 numbers and finds the total of 100 numbers and outputs this total. All 3 looping techniques are displayed:

for ... to                                  while ... endwhile                              repeat ... until

for count = 1 to 100                while count < 101                               repeat

input number                           input number                                       input number

total = total + number            total = total + number                         total = total + number

next                                        count = count + 1                                count = count + 1

print total                                endwhile                                             until count = 100

print total                                print total

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: loops there are 3 common ways of performing a
Reference No:- TGS0355423

Expected delivery within 24 Hours