WorksheetsC programming
Total questions: 15
Worksheet time: 8mins
Which data type is used to store decimal numbers in C?
int
float
double
char
How many bytes are occupied by a 'char' data type in C?
2
1
4
8
Which data type is used to store single characters in C?
char
int
float
string
What is the difference between 'float' and 'double' data types in C?
float is more accurate than double
float is for integers, double is for decimals
float is double-precision, double is single-precision
float is single-precision, double is double-precision
How is a character constant represented in C?
Enclosing a single character within double quotes
Using square brackets to represent the character
Using backticks to enclose the character
Enclosing a single character within single quotes
-------------- is other name for the variable.
Constant
Identifier
operator
function
Variables must start with ------
letter
number
special key
0
What is variable declaration in C?
Variable declaration in C is the process of specifying the data type and name of a variable before it is used in the program.
Variable declaration in C is only required for functions
Variable declaration in C is not necessary
Variable declaration in C is the process of assigning a value to a variable
What are constants in C programming?
Variables that can be changed at any point in the program
Data types that are not supported in C programming
Functions that return different values each time they are called
Fixed values that cannot be altered during program execution.
What are the naming conventions for variables in C?
Variable names in C should start with a number
Variable names in C can contain spaces
Variable names in C should follow the convention of starting with a letter or underscore, followed by letters, digits, or underscores. They should not be a keyword or contain special characters.
Variable names in C should be all uppercase
Which of the following is not a valid C variable name?
int number;
float rate;
int variable_count;
int $main;
Based on the naming rules, which of these is a valid variable name?
2nd_year
student age
_count
int
What is the primary function of "Defining" a variable?
To tell the compiler the name without allocating memory.
To allocate memory and optionally initialize the variable.
To list the keywords used in the program.
To define the special characters in the character set.
What is the purpose of a variable in C programming?
To create loops
To define functions
To manage memory allocation
To store data values
Which of the following is a valid way to initialize a variable in C?
double a = 3.14.15;
char z = "A";
float y = '5.5';
int x = 10;
