Computer Science, asked by amirb9434449219, 25 days ago


1. When will you use FOR...NEXT loop? What is the advantage in doing so

any body and me i will
mark as brainlist

Answers

Answered by usernametaken8
4

Answer:

I am not a C.S. student but I taught this chapter to my younger brother lol.

Explanation:

FOR...NEXT loop is used when a statement/statements are to be repeated a specific number of times.

The advantage of FOR...NEXT loop is that it reduces the body of the loop and hence saves both time and effort.

Example:

FOR COUNT = 1 TO 4

PRINT COUNT;"Good Day"

NEXT COUNT

Answered by Jasleen0599
2

When will you use FOR...NEXT loop and advantage

  • For Next loops have the benefit of being simpler to read and manage than Do Loops. Additionally, they are "excellent" for "working with arrays" and "less prone" to being "infinite loops".
  • To iterate across a block of statements a certain number of times, use the For. Next statement. Use a counter variable for loops, whose value changes with each iteration of the loop.
  • The 'For Next' Loop functions by executing the loop the predetermined amount of times. As an illustration, if I instructed you to manually add the numerals 1 through 10, you would first add the first two numbers, then the third number to the result, the fourth number to the result, and so on.
  • In an algorithm, loops eliminate the need for repetition of a procedure. Instead, variables can aid in regulating how frequently something happens, enhancing the program's responsiveness to human input.
  • Programming structures called loops repeat a set of instructions until a predetermined condition is satisfied. Without having to write the same (perhaps lengthy) instructions every time you want your software to carry out a task, loops let you repeatedly perform a procedure.

#SPJ2

Similar questions