Study for the Internet of Things (IOT102) Test. Access comprehensive flashcards and multiple choice questions, each with hints and explanations. Get prepared for your exam!

Multiple Choice

Which line of code begins the function that executes repeatedly in an Arduino sketch?

In an Arduino sketch, the line that begins the function that runs over and over is the function header that starts the function definition. For the loop that repeats, you’ll see something like void loop() { where the header declares the function’s return type, name, and parameters and opens its body. That line is part of the function definition because it establishes the function itself, not just a single action inside it. Inside the braces are statements that execute each cycle. A simple statement would be something you place inside the body, not the start of the function. A comment line wouldn’t start a function at all, and a banana isn’t valid code. So the correct line is the one that begins the function definition itself.

In an Arduino sketch, the line that begins the function that runs over and over is the function header that starts the function definition. For the loop that repeats, you’ll see something like void loop() { where the header declares the function’s return type, name, and parameters and opens its body. That line is part of the function definition because it establishes the function itself, not just a single action inside it. Inside the braces are statements that execute each cycle. A simple statement would be something you place inside the body, not the start of the function. A comment line wouldn’t start a function at all, and a banana isn’t valid code. So the correct line is the one that begins the function definition itself.