wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PPS MCQ on 22.11.2024

Total questions: 6

Worksheet time: 4mins

Name
Class
Date
1.

Q1. What is a structure in C programming?

a)

A special character in C programming

b)

A built-in function in C programming

c)

A user-defined data type that allows you to combine data items of different types.

d)

A type of loop in C programming

2.

What is the purpose of a pointer in C programming?

a)

To define a function

b)

To store the address of a variable

c)

To declare a structure

d)

To create a loop

3.

Which of the following is a valid way to declare an array in C?

a)

int[10] arr;

b)

array int[10];

c)

int arr[10];

d)

arr: int[10];

4.

What does the 'sizeof' operator do in C?

a)

Defines the size of an array

b)

Returns the size of a variable in bytes

c)

Allocates memory for a variable

d)

Prints the size of a variable

5.

What is the purpose of the 'malloc' function in C?

a)

To free allocated memory

b)

To initialize an array

c)

To declare a variable

d)

To allocate memory dynamically

6.

What is the output of the following code: printf("%d", 5 + 3 * 2);?

a)

10

b)

16

c)

11

d)

8