wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Variables in C Quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is a variable in C?

a)

A function in C

b)

A type of loop in C

c)

A way to represent memory location through symbols

d)

A reserved keyword in C

2.

Which of the following is a rule for defining variables in C?

a)

Variable names can contain special characters like @, #, $

b)

Variable names must start with a digit

c)

Variable names are case-insensitive

d)

Variable names cannot be the same as C keywords

3.

What is the syntax for declaring a variable in C?

a)

variable_name data_type;

b)

data_type variable_name;

c)

variable_name = data_type;

d)

data_type = variable_name;

4.

Which type of variable retains its value between multiple function calls in C?

a)

Static variable

b)

Automatic variable

c)

Global variable

d)

Local variable

5.

What is the process of reserving memory space for a variable in C?

a)

Variable Initialization

b)

Variable Declaration

c)

Variable Definition

d)

Variable Assignment

6.

Which type of variable is declared outside the function or block in C?

a)

Global variable

b)

Static variable

c)

Local variable

d)

Automatic variable

7.

What is the default type of variables declared inside a block in C?

a)

Automatic variable

b)

Static variable

c)

Global variable

d)

Local variable

8.

What is the purpose of an external variable in C?

a)

To share a variable in multiple C source files

b)

To store temporary data in a program

c)

To define a variable with a specific data type

d)

To declare a variable inside a function

9.

Which keyword is used to declare an external variable in C?

a)

static

b)

auto

c)

extern

d)

global

10.

What is the syntax for defining a variable and initializing it with a value in C?

a)

10 = int x;

b)

int = x 10;

c)

x = 10 int;

d)

int x = 10;

11.

Which type of variable is declared with the static keyword in C?

a)

Automatic variable

b)

Global variable

c)

Static variable

d)

Local variable

12.

What is the process of informing the compiler about the existence and data type of a variable in C?

a)

Variable Declaration

b)

Variable Assignment

c)

Variable Definition

d)

Variable Initialization

13.

Which type of variable is declared inside the function or block in C?

a)

Local variable

b)

Global variable

c)

Static variable

d)

Automatic variable

14.

What is the process of telling the compiler about a variable's existence and data type in C?

a)

Variable Assignment

b)

Variable Initialization

c)

Variable Definition

d)

Variable Declaration

15.

Which type of variable is available to all functions in C?

a)

Local variable

b)

Automatic variable

c)

Static variable

d)

Global variable

16.

______ are key building elements of the C programming language

a)

Variables

b)

Data Type

c)

Memory

d)

Value

17.

What is the meaning of CASE-SENSITIVE??

a)

Underscore

b)

Uppercase and lowercase letters

c)

Uppercase letters

d)

Digits and numbers

18.

____ are three components of declaring a variable

a)

Variable Declaration

b)

Variable definitions

c)

Variable assigning

d)

Variable initialization

19.

A variable that is declared with the static keyword is called _____.

a)

Local variable

b)

Global variable

c)

Static variable

d)

Automatic variable

20.

The process of reserving memory space for the variable to keep its contents during program execution is known as a _______

a)

Variable definition

b)

Variable declaration

c)

Variable assigning

d)

Variable initialization