Arduino Quiz Questions And Answers

Reviewed by Godwin Iheuwa
Godwin Iheuwa, MS (Computer Science) |
Database Administrator
Review Board Member
Godwin Iheuwa, a Database Administrator at MTN Nigeria, holds an MS in Computer Science, specializing in Agile Methodologies and Database Administration from the University of Bedfordshire and a Bachelor's in Computer Science from the University of Port Harcourt. His proficiency in SQL Server Integration Services (SSIS) and SQL Server Management Studio contributes to his expertise in database management.
, MS (Computer Science)
Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Westfw
W
Westfw
Community Contributor
Quizzes Created: 2 | Total Attempts: 18,877
Questions: 11 | Attempts: 17,685

SettingsSettingsSettings
Arduino Quiz Questions And Answers - Quiz


Here is an interesting quiz with informative questions and answers about Arduino and its related concepts. Arduino is an open-source hardware and software company, that deals in designing and manufacturing single-board microcontrollers and microcontroller kits for building digital devices. If you think you have good knowledge about Arduino, then you must take up this quiz and see how well you can score. So, are you ready? Let's start then.
Good luck!


Arduino Questions and Answers

  • 1. 

    What is the value of foo when these lines of code are executed?   foo = 12; foo = foo % 10;

    • A.

      1

    • B.

      2

    • C.

      1.2

    • D.

      None of the above

    Correct Answer
    B. 2
    Explanation
    % is the "modulus" or "remainder" operator. the value of a%b is the remainder when a is divided by b.

    Rate this question:

  • 2. 

    To subtract 1 from a variable counter, you can use the following statement(s) (check all that apply)

    • A.

      Counter - 1;

    • B.

      Counter--;

    • C.

      --counter;

    • D.

      Counter -= 1;

    • E.

      Decrement(counter);

    • F.

      Counter = counter - 1;

    Correct Answer(s)
    B. Counter--;
    C. --counter;
    D. Counter -= 1;
    F. Counter = counter - 1;
    Explanation
    The correct answer options for subtracting 1 from a variable counter are counter--, --counter, counter -= 1, and counter = counter - 1. These options all perform the same operation of subtracting 1 from the value of the counter variable. The decrement(counter) option is not a valid syntax for subtracting 1 from a variable in most programming languages.

    Rate this question:

  • 3. 

    The "Arduino Language" is best described as?

    • A.

      A subset of standard C++

    • B.

      Similar to Java

    • C.

      A special-purpose language designed for beginning programmers.

    • D.

      A subset of C#

    • E.

      C with additional library functions

    Correct Answer
    A. A subset of standard C++
    Explanation
    The "Arduino Language" is best described as a subset of standard C++. Arduino uses a simplified version of C++ to make it easier for beginners to program microcontrollers. While it shares similarities with C++, it has its own set of libraries and functions specifically designed for working with Arduino boards.

    Rate this question:

  • 4. 

    What does this line of code do?   temp = !temp;

    • A.

      Sets the variable temp to its logical compliment.

    • B.

      Converts the variable temp to a boolean value.

    • C.

      The line is not a legal Arduino statement.

    • D.

      None of the above

    • E.

      Performs a factorial calculation.

    Correct Answer
    A. Sets the variable temp to its logical compliment.
    Explanation
    The "!" operator performs a logical (boolean) complement, true becomes false, HIGH becomes LOW (0 becomes 1, any non-zero value becomes 0.)

    Rate this question:

  • 5. 

    What does this line of code do? counter++;

    • A.

      Increment counter by an amount that depends on its definition.

    • B.

      This is not a legal statement in the Arduino language.

    • C.

      Adds 1 to the variable counter

    • D.

      Returns true if the variable counter has a positive value.

    • E.

      None of the above

    Correct Answer
    A. Increment counter by an amount that depends on its definition.
    Explanation
    The line of code "counter++;" adds 1 to the variable counter. It is a shorthand way of incrementing the value of the counter by 1.

    Rate this question:

  • 6. 

    How many elements are in the array?   char textMessage[] = "Have Fun with Arduino";

    • A.

      20

    • B.

      21

    • C.

      22

    • D.

      The statement is not a legal Arduino program statement.

    • E.

      None of the above

    Correct Answer
    B. 21
    Explanation
    The array "textMessage" contains 21 elements. In C and C++ programming languages, when a string is enclosed in double quotation marks (" "), each character of the string plus a null terminator ('\0') is automatically included in the array. Therefore, the string "Have Fun with Arduino" consists of 20 characters plus a null terminator, making a total of 21 elements in the array.

    Rate this question:

  • 7. 

    What is the range of numbers you can store in a variable of type byte?

    • A.

      0 to 255

    • B.

      -128 to 127

    • C.

      0 to 9

    • D.

      0 to 65535

    • E.

      0 to 4294967295

    Correct Answer
    B. -128 to 127
    Explanation
    In most programming languages, a variable of type byte can store integer values in the range of -128 to 127. This range represents 256 different possible values, covering both positive and negative numbers.

    Rate this question:

  • 8. 

    Which language features are NOT present in the normal Arduino environment? (Check all that apply)

    • A.

      Inheritance

    • B.

      Standard Template Library

    • C.

      Exceptions

    • D.

      Operator overloading

    • E.

      Floating Point math operations

    • F.

      Object Oriented Programming

    • G.

      Pointers

    • H.

      Files

    Correct Answer(s)
    B. Standard Template Library
    C. Exceptions
    H. Files
    Explanation
    The normal Arduino environment does not include the Standard Template Library (STL), Exceptions, and the ability to work with Files. The STL is a library that provides a collection of generic algorithms and data structures, which are not available in the Arduino environment. Exceptions are a mechanism for handling errors and abnormal conditions, but Arduino does not support them. Similarly, Arduino does not have built-in support for working with files, such as reading from or writing to external storage devices.

    Rate this question:

  • 9. 

    What does the word static do in this line of code?   static int temperature = 0;

    • A.

      The variable's value is retained the next time it is accessed.

    • B.

      The value of temperature will not be allowed to change.

    • C.

      The variable will be reset to 0 each time loop() runs.

    • D.

      The variable will have a greater range than a normal int

    • E.

      The line is not a legal Arduino program statement.

    • F.

      None of the above

    Correct Answer
    A. The variable's value is retained the next time it is accessed.
    Explanation
    "static", when applied to a local variable within a function, causes the variable to become "permanent", with it's value retained until the next time it is accessed from within that function (even if the function returns and is invoked again.)

    Rate this question:

  • 10. 

     Is there anything wrong with this line of code, if yes, what?   if(myVar = true) Serial.println("The light is ON");

    • A.

      The = should be ==

    • B.

      The line has invalid syntax, and will produce a compiler error.

    • C.

      There needs to be a space after the if keyword.

    • D.

      There is nothing wrong.

    • E.

      An if statement must use braces.

    Correct Answer
    A. The = should be ==
    Explanation
    The line of code is assigning the value of true to the variable myVar instead of checking if myVar is equal to true. To compare the value, the equality operator == should be used instead of the assignment operator =.

    Rate this question:

  • 11. 

    What is the index of the letter F in this array?   char textMessage[] = "Have Fun with Arduino";

    • A.

      5

    • B.

      6

    • C.

      4

    • D.

      'F'

    • E.

      &textMessage+5

    Correct Answer
    A. 5
    Explanation
    The index of the letter F in the array "Have Fun with Arduino" is 5. This means that the letter F is the 6th character in the array, counting from 0.

    Rate this question:

Godwin Iheuwa |MS (Computer Science) |
Database Administrator
Godwin Iheuwa, a Database Administrator at MTN Nigeria, holds an MS in Computer Science, specializing in Agile Methodologies and Database Administration from the University of Bedfordshire and a Bachelor's in Computer Science from the University of Port Harcourt. His proficiency in SQL Server Integration Services (SSIS) and SQL Server Management Studio contributes to his expertise in database management.

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2024
    Quiz Edited by
    ProProfs Editorial Team

    Expert Reviewed by
    Godwin Iheuwa
  • Aug 30, 2018
    Quiz Created by
    Westfw
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.