MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
To repeat a fixed number of times use a
A
while loop
B
for loop
C
if loop
D
indentation
Explanation: 

Detailed explanation-1: -You can do the same type of for loop if you want to loop over every character in a string. To loop through a set of code a certain number of times, you can use the range() function, which returns a list of numbers starting from 0 to the specified end number.

Detailed explanation-2: -Repetitive loops let you repeat instructions a certain number of times. Conditional loops use a condition to control repeating. There are two types of conditional loops, DO WHILE and DO UNTIL. The simplest repetitive loop tells the language processor to repeat a group of instructions a specific number of times.

There is 1 question to complete.