top of page

IOT Arduino MCQ

Writer's picture: Rajesh SinghRajesh Singh

Updated: Jan 10

Building IOT Applications MCQ:


Q1. Which Microcontroller is used in Arduino UNO prototyping board?

A.    ATmega328m

B.     ATmega328p

C.     ATmega2560

D.    None of Above

Ans: B

Q2. What is the use of the Interrupt Service Routine in an Arduino ?

A.    To boot up the Arduino

B.     To exit any code that is running

C.     To automate functions

D.    To make more memory

Ans: C

Q3. What will be the output of the following code?

#include <stdio.h>

void solve() {

 char ch[5] = "abcde";

int ans = 0;

for(int i = 0; i< 5; i++) {

ans += (ch[i] - 'a');

 }

printf("%d", ans);

}

int main() {

solve();

return 0;

}

A.    5

B.     20

C.     40

D.    10

Ans: D

Q4. A set of homogenous data stored in consecutive memory locations is called:

A.    List

B.     Structure

C.     Array

D.    Union

Ans: C

Q5. How can you throw an error with preprocessor directives to Arduino compiler, forcing to stop compilation?

A.    #warning

B.     #stop

C.     #cut

D.    #error

Ans: D

Q6. The process of assessment of the speaker’s content while listening is called __________.

A.    Critical listening

B.     Dialogic listening

C.     Comprehensive listening

D.    Systematic listening

Ans: A

Q7. How should the tone of a speaker be like?

A.    Loud

B.     Clear

C.     Low

D.    Soft

Ans: B

Q8. What is the correct execution process of an Arduino code ?

A.    Preprocessor->Editor->Compiler

B.     Editor->Preprocessor->Compiler

C.     Compiler->Preprocessor->Editor

D.    Editor->Compiler->Preprocessor

Ans: B

Q9. What is the bit size used in 8051 ?

A.    4-bit

B.     8-bit

C.     16-bit

D.    32-bit

Ans: B

Q10. What type of signal does the analogWrite() function output ?

A.    Pulse Code Modulated Signal

B.     Frequency Modulated Signal

C.     Pulse Width Modulated Signal

D.    Pulse Amplitude Modulated Signal

Ans: C

Q11. During embedded design, which design considers both hardware and software?

A.    Memory Design

B.     Software / hardware Design

C.     Platform-based Design

D.    Peripheral Design

Ans: B

Q12. Which of the following is used to upload the Arduino Sketches to the board?

A.    avrgcc

B.     g++

C.     cpython

D.    avrdude

Ans: D

Q13. What is the size of RAM memory in 8051?

A.    32 bytes

B.     64 bytes

C.     128 bytes

D.    256 bytes

Ans: C

Q14. Functions can pass information in which of the following ways ?

A.    Value

B.     Reference

C.     Stack

D.    Both (A) and (B)

Ans: D

Q15. Predict the output of the following code if the

object is moving away from the sensor :

int op = 7;

int isBarrier = HIGH;

void setup() {

pinMode(op, INPUT);

Serial.begin(9600);

}

void loop() {

isBarrier = digitalRead(op);

 if (isBarrier == LOW) {

Serial.println("1+");

 }

 else {

Serial.print("clear+");

 }

delay(100);

}

A.    clear+clear+1+1

B.     1+1+clear+clear

C.     clear+clear+clear+clear

D.    1+1+clear+1

Ans: D

Q16. This is a combination of hardware and software to perform a specific task.

A.    IoT System

B.     Embedded System

C.     Grid System

D.    Cloud System

Ans: B

Q17. What are Arduino Codes are referred to?

A.    sketches

B.     drawings

C.     links

D.    notes

Ans: A

Q18. Which of the following method is better for task swapping in the embedded systems? एंबेडेड सिस्टम में टास्क स्वैपिंग के लिए निम्नलिखित में से कौन सी विधि बेहतर है?

A.    time slice

B.     RMS

C.     cooperative multitasking

D.    pre-emptive

Ans: D

Q19. The scope that hacker can use to break into a system is called as :

A.    Attack surface

B.     Defense

C.     Principle of least privilege

D.    Risk mitigation

Ans: A

Q20. Which of the following is the property of embedded C language? निम्नलिखित में से कौन सा एंबेडेड C भाषा का गुण है?

A.    Hardware independent

B.     Used for web applications

C.     Used with limited resources

D.    Used for native development

D.

Ans: C

Q21. Embedded C is:

A.    A subset of traditional C

B.     An extension of traditional C

C.     A superset of traditional C

D.    Same as traditional C

Ans: B

Q22. What is the outcome of the following

Arduino code ?

void setup() {

Serial.begin(9600);

}

void setup() {

Serial.write(20);

}           

A.    Send a signal to pin 20 on the Arduino board

B.     Send a octal number of 20 through the Serial pins

C.     Send a byte with value 20 through the Serial pins

D.    Send a hexadecimal number of 20 through the Serial pins

Ans: C

Q23. Which of the following is NOT a data type ?

A.    sbit

B.     dbit

C.     bit

D.    unsigned int

Ans: B

Q24. What is the functions preprocessor directive in Embedded C programming?

A.    Tell compiler where to find symbols that are not present in program

B.     Give compiler instructions to compile the program

C.     Define variables

D.    Define functions

Ans: A

Q25. Predict the output of the following code if the object is moving towards the sensor.

int op = 6;

int isBarrier = HIGH;

void setup() {

pinMode(op, INPUT);

Serial.begin(9600);

}               

void loop() {

isBarrier = digitalRead(op);

if (isBarrier == LOW) {

Serial.println("1+");

}

else {

Serial.print("clear+");

}

delay(100);

}

A.    clear+clear+1+1

B.     1+1+clear+1

C.     1+1+clear+clear

D.    clear+clear+clear+clear

 

Ans: D

Q26. What is the output of below code?

#include<EEPROM.h>

int pin=13;

void setup()

{

pinMode(pin,OUTPUT);

Serial.begin(9600);

{

void loop()

for(int i=0;i<EEPROM.Length();i++)

{

EEPROM.write(i,1)

digitalWrite(pin,HIGH;

exit(0);

}

}

A. Clear EEPROM

B. Fill EEPROM with 1's

C. Expor EEPROM data

D. Fill EEPROM with 0's

Ans: B

Q27. How many analog pins are used in Arduino Mega board ?

A.    12

B.     16

C.     8

D.    14

Ans: 16 (The 8-bit board with 54 digital pins, 16 analog inputs, and 4 serial ports.)

Q28. What language is the Arduino IDE built on ?

A.    Java

B.     HTML

C.     C/C++

D.    Python

Ans: A

Q29. IoT devices can easily lead to catastrophe without __________.

A.    Software

B.     Devices

C.     Cloud

D.    Management system

Ans: D

Q30. What will be the output of the following Arduino code ?

void main() {

int k = 0;

double d = 10.21;

printf(“%lu”, sizeof(k + d));

}

void loop() {}

A.    10.21

B.     8

C.     null

D.    23

Ans: B(The sizes of int and double are 4 and 8 respectively, a is an integer variable whereas d is a double variable)

Q31. What does the following code do?

 

void main() {

    int* ptr = (int*)malloc(100 * sizeof(int));

}

A.    Static Memory Allocation

B.     Static Memory Clearance

C.     Dynamic Memory Allocation

D.    Dynamic Memory Clearance

Ans: C

Q32. What is the output of the code given below?

void main() {

    Serial.begin();

    int x = 3;

    printf("%d\n", sizeof(x++));

    printf("x = %d", x);

}

A.    3

B.     4

C.     Runtime Error

D.    Null

Ans: A

Q33. What is the effect of performing AND operation of R with 0xFE ?

A.    Setting a selected bit of R

B.     Clearing a selected bit of R

C.     Complement selected bit of R

D.    None of these

D.

Ans: B

Q35. Which type of variables are retained for use throughout the program in RAM and not reallocated during program execution?

A.    Automatic

B.     Static

C.     Dynamic

D.    All of these

Ans: B

Q36. The Atmega 168 is an __________ bit chip.

A.    32

B.     64

C.     8

D.    16

Ans: C

Q37. The advantages of using functions is__________.

A.    Partition larger task into smaller tasks

B.     Code reusability

C.     Manage complexity

D.    All of these

Ans: D

Q38. ____ is heart of Computer system.

A.    Memory

B.     I/O

C.     Counter

D.    Processor

Ans: D

Q39. Which one is not Leading Cloud Services for IoT Deployments?

A.    AWS

B.     IBM Watson

C.     Microsoft Azure

D.    Google Drive

Ans: D

Q40. How are comments denoted in Embedded C ?

A.    #

B.     B) %

C.     ;

D.    //

Ans: D

Q41. How are multiline comments denoted in Embedded C ?

A.    ##

B.     /* */

C.     %%

D.    //

Ans: B

Q42. How many times does the setup() function run on every startup of the  Arduino System ?

A.    4

B.     5

C.     2

D.    1

Ans: D

Q43. Which of the following must be present in a microcontroller?

A.    CPU, ROM, I/O ports and timers

B.     RAM, ROM, I/O ports and timers

C.     CPU, RAM, I/O ports and timers

D.    CPU, RAM, ROM, I/O ports and timers

Ans: D

Q44. Which of the following are the basic functions of a timer?

A.    Control the compare, capture mode

B.     Act as a counter

C.     Provide a time delay

D.    All of these

Ans: C

Q45. Which of the following devices are specifically being used for converting serial to parallel and from parallel to serial respectively?

A.    microcontroller

B.     timers

C.     counters

D.    registers

Ans: D

Q46. Which memory storage is widely used in Embedded Systems?

A.    EEPROM

B.     DRAM

C.     Flash memory

D.    SRAM

Ans: C

Q47. Which one is not a control structure?

A.    While

B.     If..else

C.     #define

D.    Case

Ans: C

Q48. LDR sensor works on the principle of :

A.    Resistivity

B.     Photoconductivity

C.     Conductivity

D.    None of Above

Ans: C

Q49. What is the efficiency of the DC motor at maximum power?

A.    90%

B.     100%

C.     Around 80%

D.    Less than 50%

Ans: D

Q50. What will be the output of the following code ?

#include <stdio.h>

void solve() {

int b = 4;

int res = b++ + ++b + ++b;

printf("%d", res);

}

int main() {

solve();

return 0;

}

A.    12

B.     15

C.     17

D.    20

Ans: C

Q51. If 1 means an object is detected and 0 meaning no object is detected, then considering the sensor stationary, what can be the possible movement of object if the output by the sensor is observed as 111000?

A.    Object is stationary

B.     Object is oscillating side by side

C.     Object is moving away

D.    Object is moving closer

Ans: C       

Q52. If 1 means an object is detected and 0 meaning no object is detected, then considering the sensor is stationary, what can be said about the movement of the object if the output by the sensor is 1010101?

A.    Object is stationary

B.     Object is oscillating side by side

C.     Object is continuously moving away

D.    Object is continuously moving closer

Ans: B

Q53. What is the output of the following

program ?

for( ; ; )

{

 Statements

}

A.    Error

B.     Statements will run forever

C.     This an infinite loop

D.    Both (B) and (C)

Ans: C

Q54. Which processor helps in carrying out floating point calculations?

A.    microprocessor

B.     coprocessor

C.     microcontroller

D.    controller

Ans: B

Q55. What is Arduino?

A.    Programming language

B.     Image editing software

C.     Open-source electronics platform

D.    Text editor

Ans: C         

Q56. Which of the following is an example of an LDR sensor application?

A.    Lights

B.     Clock

C.     Voltage Divider

D.    All of above

Ans: D

Q57. What will be the output of the following code?

 int main()

 {

 int i = 25;

 int k =i %4;

 printf("%d\n", k);

 }

A.    1

B.     2

C.     3

D.    4

Ans: A

Q58. Which of the Arduino pins is connected to the Data5 (D5) pin on the 16x2 character LCD?

 Liquid Crystal lcd(12, 11, 5, 4, 3, 2);

A.    Pin No. 3

B.     Pin No. 2

C.     Pin No. 5

D.    Pin No. 4

Ans: C

Q59. The process of building IoT hardware and devices enhanced with smart sensors and embedded system using many of the shelf components like sensors, circuits and microcontrollers is called?

A.    Prototyping

B.     Casting

C.     Protocasting

D.    Protocol typing

Ans: A

Q60. Which command is the 9th pin on Arduino set as output?

A.    int sensorPin = 9;

B.     int sensorValue = 9;

C.     pinMode(9, OUTPUT);

D.    digitalWrite(9, HIGH);

Ans: C

89 views0 comments

Recent Posts

See All

Soft skills-Personality Development MCQ

Q1. Which of the following is NOT a hard skill? A.    Typing Speed B.     Machine Operation C.     Time Management D.    Coding Ans: C...

IOT Sensor MCQ

Sensor MCQ for O level Exam: Q1. Which sensor is used in Mobile phones? A.      Capacitive Touch Sensor B.      Temperature Sensor...

Comments


bottom of page