1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
spin [16.1K]
3 years ago
9

When do you use a for loop instead of a while loop? (There may be more than one answer.)

Computers and Technology
1 answer:
statuscvo [17]3 years ago
8 0

Answer:

- You know how many times you want the loop to run.

- When there is a defined start and end.

Explanation:

Required:

When to use for instead of while loop?

First, it should be noted that both for loop and while loop are used for iteration. However, depending on the scenario; there is preference on one to the other.

The basic syntax of for loop is:

for(start;end;condition)\{\}

<em>The condition could either be increment or decrement</em>

The basic syntax of while loop is:

while(condition)\{\}

<em>The condition could be any condition whatsoever</em>

Analyzing the options one after the other.

1. How many times the loop to run.

The for loop is preferred here because of the simplicity of the for loop.

2. & 3. Both the for and while loops are used for code repetition and to perform number calculations

4. Defined start and end.

From the syntax of the for loop

for(start;end;condition)\{\}

<em />

A for loop has a definite start and end in its basic syntax and is more preferable to use instead of a while loop.

<em />

<em />

Hence, 1 & 4 answer the question

You might be interested in
How would you identify communication equipment?
eimsori [14]

Answer

Explanation:

There should be more context to this question but I would say there is a variety of things that could be seen as communication equipment, such as email, telephone, voice message, through mail.

6 0
3 years ago
In Excel, ____ is/are used to place worksheet, column, and row titles on a worksheet.
vladimir1956 [14]
In excel, [Text] is used to place worksheet, column and row titles on a worksheet.
In excel you can inset text to make comment, to input words or number and to make title. 
8 0
3 years ago
What is the name for unwanted software that installs when you click some links?
Rudik [331]
Malware you're welcome 
8 0
4 years ago
Read 2 more answers
You have been studying processors. Your instructor has asked you to help prepare a lecture for introductory students learning ab
Svetlanka [38]

Answer:

Executing is the correct answer of the following question.

Explanation:

The ALU conducts data calculations, and is part of the system cycle execution process.Information and software engineering is the mechanism by which a software or digital machine conducts a computer program's instructions.The system instructions trigger patterns of basic acts at the performing computer.

Computer programs may be enacted in a cluster phase lacking direct human or a recipient-type instructions in an interpreter's collaborative process.

5 0
3 years ago
A Windows user is locked out of her computer, and you must log into the local administrator account Helpdesk Admin. Which would
Damm [24]

Answer:

B is the correct answer

5 0
3 years ago
Other questions:
  • When long labels are required, which of these commands can you use to improve readability of a worksheet? .
    7·2 answers
  • Does anyone know the code for codeHS 5.4.7 teenagers?
    8·1 answer
  • Hi weegy, what is the latest android os?
    9·1 answer
  • It is a small hand tool used generally in decorative works such as making garnishes
    15·1 answer
  • What does this mean in python?
    5·1 answer
  • PLEASE HELPP!!!!!
    14·1 answer
  • Explain how to utilize the computer in rooms management.​
    13·1 answer
  • Write the code for the following problem.
    9·1 answer
  • You are on vacation with your family and have been nominated to be the family photographer. You have a 13.1-megapixel camera. Wh
    12·2 answers
  • PYTHON!
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!