WorksheetsPPS MCQ on 22.11.2024
Total questions: 6
Worksheet time: 4mins
Q1. What is a structure in C programming?
A special character in C programming
A built-in function in C programming
A user-defined data type that allows you to combine data items of different types.
A type of loop in C programming
What is the purpose of a pointer in C programming?
To define a function
To store the address of a variable
To declare a structure
To create a loop
Which of the following is a valid way to declare an array in C?
int[10] arr;
array int[10];
int arr[10];
arr: int[10];
What does the 'sizeof' operator do in C?
Defines the size of an array
Returns the size of a variable in bytes
Allocates memory for a variable
Prints the size of a variable
What is the purpose of the 'malloc' function in C?
To free allocated memory
To initialize an array
To declare a variable
To allocate memory dynamically
What is the output of the following code: printf("%d", 5 + 3 * 2);?
10
16
11
8
