Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

BASIC PROGRAMMING

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

What is the smallest unit of data in a computer?

a)

Byte

b)

Bit

c)

Word

d)

Nibble

2.

Which programming language is known as the "mother of all languages"?

a)

Python

b)

C

c)

Java

d)

COBOL

3.

What does a compiler do?

a)

Executes code line by line

b)

Translates high-level code into machine language

c)

Checks for runtime errors

d)

Manages memory allocation

4.

Which of the following is a logical operator in C?

a)

&&

b)

=

c)

++

d)

%

5.

Which data structure uses Last-In-First-Out (LIFO)?

a)

Queue

b)

Stack

c)

Linked List

d)

Graph

6.

What is the file extension of a C++ program?

a)

.java

b)

.c

c)

.cpp

d)

.py

7.

Which keyword is used to declare a constant variable in C?

a)

const

b)

static

c)

final

d)

immutable

8.

What does HTML stand for?

a)

HyperText Markup Language

b)

HyperTransfer Markup Language

c)

HighText Machine Language

d)

HyperTransfer Machine Language

9.

What is the default value of an integer in Java?

a)

1

b)

-1

c)

0

d)

null

10.

Which of the following is NOT a type of loop?

a)

for

b)

while

c)

repeat-until

d)

do-while

11.

Which of the following is used to take input in Python?

a)

scanf()

b)

cin

c)

input()

d)

println

12.

What does SQL stand for?

a)

Simple Query Language

b)

Structured Query Language

c)

Sequential Query Language

d)

Standard Query Language

13.

Which operator is used for exponentiation in Python?

a)

^

b)

**

c)

*

d)

%

14.

What is a function?

a)

A block of code that performs a specific task

b)

A reserved keyword

c)

A type of variable

d)

An operator

15.

Which of the following is NOT a primitive data type in Java?

a)

int

b)

float

c)

string

d)

double

16.

What does the return keyword do in a function?

a)

Loops through a block of code

b)

Exits the function and optionally passes back a value

c)

Initializes a variable

d)

Declares a function

17.

Which command is used to compile a Java program?

a)

java

b)

javac

c)

javadoc

d)

run

18.

Which of the following is an example of a derived data type in C?

a)

int

b)

char

c)

array

d)

float

19.

What is the purpose of a pointer in C?

a)

To store large data values

b)

To point to the address of another variable

c)

To manage I/O operations

d)

To create arrays dynamically

20.

Which of the following is used to represent a group of similar elements?

a)

Structure

b)

Array

c)

Pointer

d)

Enum

21.

What is the default access modifier in Java?

a)

Public

b)

Private

c)

Protected

d)

Package-private

22.

Which loop executes at least once, even if the condition is false?

a)

for

b)

while

c)

do-while

d)

foreach

23.

What is the size of the int data type in C on most systems?

a)

2 bytes

b)

4 bytes

c)

8 bytes

d)

Depends on the compiler

24.

What is the primary purpose of the main() function in C?

a)

To declare variables

b)

To serve as the entry point of the program

c)

To execute loops

d)

To include header files

25.

What does the acronym OOP stand for?

a)

Open Object Program

b)

Object-Oriented Programming

c)

Operational Output Process

d)

Ordered Object Protocol