Quiz
C Language
1. Which keyword is used to declare a constant in C?
const
constant
define
static
2. Which function is used to print output in C?
print()
printf()
cout
write()
3. What is the default return type of a C function if not specified?
void
int
float
char
4. Which header file is needed for printf() and scanf()?
stdlib.h
stdio.h
conio.h
math.h
5. Which operator is used to access a value at a memory address?
&
*
->
.
6. What is the range of 'char' data type in C?
0 to 255
-128 to 127
0 to 127
-255 to 255
7. Which loop is guaranteed to run at least once?
for
while
do-while
goto
8. Which format specifier is used for printing float values?
%f
%lf
%d
%c
9. Which keyword is used to include a library in C?
import
include
#include
library
10. Which of these is a valid comment in C?
// Comment
/* Comment */
Both A and B
# Comment