Font size
WorksheetsVariables in C Quiz
Total questions: 20
Worksheet time: 10mins
What is a variable in C?
A function in C
A type of loop in C
A way to represent memory location through symbols
A reserved keyword in C
Which of the following is a rule for defining variables in C?
Variable names can contain special characters like @, #, $
Variable names must start with a digit
Variable names are case-insensitive
Variable names cannot be the same as C keywords
What is the syntax for declaring a variable in C?
variable_name data_type;
data_type variable_name;
variable_name = data_type;
data_type = variable_name;
Which type of variable retains its value between multiple function calls in C?
Static variable
Automatic variable
Global variable
Local variable
What is the process of reserving memory space for a variable in C?
Variable Initialization
Variable Declaration
Variable Definition
Variable Assignment
Which type of variable is declared outside the function or block in C?
Global variable
Static variable
Local variable
Automatic variable
What is the default type of variables declared inside a block in C?
Automatic variable
Static variable
Global variable
Local variable
What is the purpose of an external variable in C?
To share a variable in multiple C source files
To store temporary data in a program
To define a variable with a specific data type
To declare a variable inside a function
Which keyword is used to declare an external variable in C?
static
auto
extern
global
What is the syntax for defining a variable and initializing it with a value in C?
10 = int x;
int = x 10;
x = 10 int;
int x = 10;
Which type of variable is declared with the static keyword in C?
Automatic variable
Global variable
Static variable
Local variable
What is the process of informing the compiler about the existence and data type of a variable in C?
Variable Declaration
Variable Assignment
Variable Definition
Variable Initialization
Which type of variable is declared inside the function or block in C?
Local variable
Global variable
Static variable
Automatic variable
What is the process of telling the compiler about a variable's existence and data type in C?
Variable Assignment
Variable Initialization
Variable Definition
Variable Declaration
Which type of variable is available to all functions in C?
Local variable
Automatic variable
Static variable
Global variable
______ are key building elements of the C programming language
Variables
Data Type
Memory
Value
What is the meaning of CASE-SENSITIVE??
Underscore
Uppercase and lowercase letters
Uppercase letters
Digits and numbers
____ are three components of declaring a variable
Variable Declaration
Variable definitions
Variable assigning
Variable initialization
A variable that is declared with the static keyword is called _____.
Local variable
Global variable
Static variable
Automatic variable
The process of reserving memory space for the variable to keep its contents during program execution is known as a _______
Variable definition
Variable declaration
Variable assigning
Variable initialization
