Computer Science, asked by intekhab92, 1 year ago

please anyone help in these question

Attachments:

Answers

Answered by jahnavi80
1
1).Visual Basic loop structures allow you to run one or more lines of code repetitively. You can repeat the statements in a loop structure until a condition is True , until a condition is False , a specified number of times, or once for each element in a collection.
2).A control structure is a block of programming that analyzes variables and chooses a direction in which to go based on given parameters. ... Hence it is the basic decision-making process in computing; flow control determines how a computer will respond when given certain conditions and parameters
3).A for loop enables a particular set of conditions to be executed repeatedly until a condition is satisfied. Imagine a situation where you would have to print numbers from 1 to 100. What would you do? Will you type in the printf command a hundred times or try to copy paste it? This simple task would take an eternity. Using a 'for loop' you can perform this action in 3 statements. This is the most basic example of the for loop. It can also be used in many advanced scenarios depending on the problem statement.
4).Major difference between for and whileloop is at pragmatic level because under the hood, both loops are all the same conditional goto; therefore the choice between while and for is arbitrary, based on which seems clearer. Both for and whileloops are entry controlled loops that means test condition is checked for truth while entering into the loop's body.

The for is usually appropriate for loops in which the initialization and increment are single statements and logically related, since it is more compact than while and it keeps the loop control statements together in one place.

Similar questions