NEW
Font size
WorksheetsNEXUS'25
Total questions: 20
Worksheet time: 10mins
What is the correct syntax to declare a variable in C?
int num;
int num:
int num = 10.5;
num int;
Which of the following is a correct C identifier?
1variable
_variable1
variable-1
variable 1
What is the size of an int data type in C (on most systems)?
1 byte
2 bytes
4 bytes
8 bytes
What's output of the the following code?
Equal
Not Equal
Error
None of this above
What will be the output of the following code?
5
6
Compilation error
Undefined behavior
What will be the output of the following code?
2 3
3 2
5 1
1 5
What is the output of the following code?
5
10
Compile-time error
Undefined behavior
What is the difference between ++i and i++ in C?
++i increments i after its current value is used, i++ increments i before its current value is used.
++i increments i before its current value is used, i++ increments i after its current value is used.
Both are the same.
++i is a syntax error
What is the output of the following code?
5
4
20
1
What will be the output of the following code?
24
21
20
18
Which of the following is not a valid memory management function in C?
malloc()
calloc()
realloc()
freeall()
Which of the following loops will execute the body at least once, regardless of the condition?
for loop
while loop
do-while loop
None of the above
What is the output of the following code?
0 1 2 3 4
0 1 2 3
0 1 2
1 2 3 4
Which of the following is a valid if statement in C?
if x > 5 then
if (x > 5)
if x > 5;
if (x > 5);
Which of the following is used to take input from the user in C?
printf
scanf
input
cin
Which of the following is a valid way to write a comment in C?
// This is a comment
*This is a comment *
* This is a comment
## This is a commen
What is the correct way to define a constant value in C?
#define PI 3.14
const PI = 3.14
PI = 3.14;
constant PI = 3.14;
C is considered as a _______type language?
High level
Low level
Mid level
None of this
which library is used to get input from user in C?
<Stdio.h>
<math.h>
<conio.h>
<stdio.h>
What will be the output of the following code?
The address of a
20
The value of p
Compile-time error
