WorksheetsCode Twisters Round 1 Demo
Total questions: 10
Worksheet time: 2mins
1. What is the format specifier for printing an integer in C?
%d
%c
%f
%s
2. Which operator is used to get the address of a variable?
*
&
-
@
3. Which of the following is a correct syntax to declare a pointer?
*int p;
int p*;
int *p;
int p;
4. Which function is used to read a string from standard input?
scanf()
fgets()
getch()
gets()
5. Which loop guarantees at least one execution of the loop body?
for loop
do-while loop
while loop
None of the Above
6. What will be the output of printf("%d", 5/2);?
2
2.5
3
0
7. What is the return type of the malloc() function?
int
char*
void*
float*
8. Which of the following are keywords in C?
int, char, printf
for , if , float
scanf , while ,void
double, extern , register
9. Which of the following functions are used to allocate memory dynamically?
malloc() , free()
scanf(),printf()
calloc(),malloc()
realloc() , free()
What will sizeof(char) return?
2
4
1
8
