C Language Quiz (Set 1) C Language (Set 1) 1 / 10 Which header file should be included to work with dynamic memory allocation functions? 2 / 10 What does the 'scanf' function in C do? Prints formatted output. Reads input from the user. Allocates memory for variables. Converts strings to integers. 3 / 10 What is the correct syntax for a 'for' loop in C? for (i = 0; i < n; i++) for i = 0 to n for (i = 0; i < n) for i = 0; i < n; i++ 4 / 10 Which operator is used to access the value at a specific index in an array? >> [] // $$ 5 / 10 What is the output of the following C code?\n\n```c\n#include <stdio.h>\nint main() {\n int i = 0;\n while (i < 5) {\n printf(\"%d \", i);\n i++;\n }\n return 0;\n}``` 0 1 2 3 4 5 5 5 5 5 1 2 3 4 5 0 1 2 3 4 5 6 / 10 Which C keyword is used to define an enumeration? enum enumdef enumeration defenum 7 / 10 What is the purpose of the 'sizeof' operator in C? It calculates the size of an array. It calculates the size of a variable in bytes. It calculates the length of a string. It calculates the size of a pointer. 8 / 10 Which C library function is used to allocate memory for an array? malloc allocate memalloc create 9 / 10 What is the correct way to initialize an integer variable 'x' with the value 10? int x = 10; x = int(10); x := 10; x = 10; 10 / 10 In C, which keyword is used to declare a function? func method def int Your score isThe average score is 0% 0% Restart quiz