wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

RTES

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Explain the process of compilation and linking in C.

a)

Compilation in C only includes converting source code to machine code without any linking process.

b)

The process of compilation and linking in C includes preprocessing, compiling to assembly, assembling to object code, and linking to create an executable.

c)

The process of compilation in C involves only writing code without any further steps.

d)

Linking in C is the same as executing the program directly without compilation.

2.

What are preprocessor directives in C? Provide examples.

a)

#include

b)

#define E 2.71

c)

#if RELEASE

d)

Examples of preprocessor directives include: 1. #include 2. #define PI 3.14 3. #ifdef DEBUG

3.

Differentiate between static and dynamic memory allocation in C.

a)

Static memory allocation is fixed at compile time, while dynamic memory allocation is flexible and occurs at runtime.

b)

Static memory allocation can be resized during program execution, while dynamic memory allocation cannot.

c)

Static memory allocation occurs at runtime, while dynamic memory allocation is fixed at compile time.

d)

Dynamic memory allocation is done at compile time, while static memory allocation is flexible and occurs at runtime.

4.

What is the difference between break and continue in C? Provide examples.

a)

'break' is used for function calls; 'continue' is for loops only.

b)

'break' and 'continue' have the same effect in loops.

c)

'break' skips to the next iteration; 'continue' exits the loop.

d)

'break' exits the loop; 'continue' skips to the next iteration. Example: for (int i = 0; i < 5; i++) { if (i == 2) break; // exits loop when i is 2 printf("%d ", i); } for (int i = 0; i < 5; i++) { if (i == 2) continue; // skips the rest of the loop when i is 2 printf("%d ", i); }

5.

Define a string in C and explain how it is declared. What is the last element in a string?

a)

The last element in a string is the first character.

b)

The last element in a string is a space character.

c)

The last element in a string is a comma.

d)

The last element in a string is the null character '\0'.

6.

Write a C program to check if a number is even or odd using the bitwise AND operator.

a)

Use the expression 'if (number & 1) { printf("Odd\n"); } else { printf("Even\n"); }' in the C program.

b)

Use 'if (number & 2) { printf("Even\n"); }' to check for even numbers.

c)

Check if 'number / 2' is an integer to determine if it's even or odd.

d)

Use 'if (number % 2 == 0) { printf("Even\n"); }' to check even numbers.

7.

List the basic components required for designing a digital clock using Arduino and describe their roles.

a)

Bluetooth Module

b)

Speaker Module

c)

Microcontroller Unit (MCU)

d)

Arduino Board, Real-Time Clock (RTC) Module, Display (LCD or 7-segment), Power Supply, Connecting Wires

8.

Write a program for a digital clock using Arduino.

a)

rtc.setTime(12, 0, 0);

b)

#include

c)

lcd.print(now.day());

d)

#include #include #include RTC_DS3231 rtc; LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { lcd.begin(16, 2); Wire.begin(); rtc.begin(); } void loop() { DateTime now = rtc.now(); lcd.setCursor(0, 0); lcd.print(now.hour()); lcd.print(':'); lcd.print(now.minute()); lcd.print(':'); lcd.print(now.second()); delay(1000); }

9.

What are the basic components required for designing a smart card reader using Arduino and their roles?

a)

Arduino board, smart card reader module, power supply, connecting wires

b)

Microcontroller, smart card emulator, Ethernet cable, soldering iron

c)

Arduino board, barcode scanner, solar panel, HDMI cable

d)

Raspberry Pi board, RFID reader module, battery pack, USB cables

10.

Explain the architecture of an automated meter reading (AMR) system with a block diagram.

a)

Analog Meter, Local Display, Manual Data Entry, and Printer

b)

Smart Meter, Cloud Storage, Mobile App, and Backup Server

c)

The architecture of an AMR system includes Meter, Communication Module, Data Collector, Central Server, and User Interface.

d)

Power Supply Unit, Data Logger, User Manual, and Network Switch