ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 460 - SK0-005 discussion

Report
Export

Which of the following should a server administrator use when writing a script with a function that needs to be run ten times?

A.

Loop

Answers
A.

Loop

B.

Variable

Answers
B.

Variable

C.

Comparator

Answers
C.

Comparator

D.

Conditional

Answers
D.

Conditional

Suggested answer: A

Explanation:

A loop is a programming construct used to repeat a block of code multiple times. In this case, if a function needs to run ten times, a loop (such as a for loop or while loop) would be the appropriate choice.

Loop (Answer A): This allows the function to be executed repeatedly without writing redundant code.

Variable (Option B): A variable is used to store data, but it doesn't handle repetition.

Comparator (Option C): Comparators are used to compare values, not for repeating code.

Conditional (Option D): Conditionals (if, else) are used for decision-making, not repeating actions multiple times.

CompTIA Server+

Reference:

This topic is related to SK0-005 Objective 1.1: Understand basic scripting and automation concepts.

asked 06/11/2024
Martin Lundgren
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first