NEW
Font size
WorksheetsMastering C Programming Concepts
Total questions: 15
Worksheet time: 8mins
What are the basic data types available in C?
int8, int16, int32, int64, float
string, boolean, list, map, object
int, float, double, char, void
byte, short, long, decimal, reference
How do you declare an integer variable in C?
int myVariable;
float myVariable;
num myVariable;
integer myVariable;
What is the result of the expression 5 + 3 * 2 in C?
11
8
10
9
Which operator is used for logical AND in C?
&
and
&&
||
What is the purpose of the 'if' statement in C?
To declare variables and their types in a program.
To execute code conditionally based on a boolean expression.
To define a loop that iterates over a set of values.
To handle exceptions and errors during runtime.
What is the size of a 'char' data type in C?
4 bytes
1 byte
1 kilobyte
2 bytes
How do you declare a variable with a float data type?
my_float = 3,14
float my_float = 3.14
my_float : 3.14
my_float = 3.14
What is the output of the expression (10 > 5) && (5 < 3)?
null
undefined
true
false
What control structure would you use to execute a block of code multiple times?
Exception handling (try, catch)
Loop (for, while, do-while)
Function call (invoke, execute)
Conditional statement (if, switch)
What is the difference between '==' and '=' in C?
'=' is for both assignment and comparison.
'=' is for comparison; '==' is for assignment.
'=' is for assignment; '==' is for comparison.
'==' is used for variable declaration; '=' is for initialization.
How do you declare a constant variable in C?
int myConstant = 10;
const int myConstant = 10;
const myConstant = 10;
define const myConstant = 10;
Which operator is used for logical OR in C?
&&
|
||=
||
What is the purpose of the 'switch' statement in C?
The 'switch' statement is used for defining functions in C.
The purpose of the 'switch' statement in C is to simplify multi-way branching based on the value of a variable.
The 'switch' statement handles error exceptions in C.
The 'switch' statement is for creating loops in C.
What is the range of values for a signed int in C?
-128 to 127
0 to 4294967295
-32768 to 32767
-2147483648 to 2147483647
What control structure is used for decision making in C?
for and while
do-while and foreach
try-catch and finally
if-else and switch
