C Language Quiz (Set 10) C Language (Set 10) 1 / 10 What is the purpose of the 'offsetof' macro in C? To calculate the size of a data structure. To determine the position of a field within a structure. To include a header file. To calculate the difference between two pointers. 2 / 10 Which C library function is used to convert a string to an integer in a specific base? strbaseint strtointbase strtol strtolong 3 / 10 What is the purpose of the 'puts' function in C? To display a string on the screen. To write a string to a file. To retrieve a string from a file. To get a string input from the user. 4 / 10 Which C library function is used to read a line from a file? readline fgets getline readfile 5 / 10 What is the purpose of the 'switch' statement in C? To create a loop. To define a new function. To choose between multiple code blocks based on a value. To print output. 6 / 10 In C, what is the purpose of the 'time_t' data type? To store time and date values. To store wide characters. To store integer values. To store floating-point values. 7 / 10 What is the purpose of the 'volatile' keyword when used in a parameter declaration in C? To declare a volatile parameter. To indicate that the parameter is volatile. To define a parameter with volatile memory allocation. To indicate that the parameter uses volatile variables. 8 / 10 Which C library function is used to allocate memory for an array of elements? memalloc arrayalloc malloc dynalloc 9 / 10 What is the result of the expression '5 + 3 * 2' in C? 11 16 13 10 10 / 10 What is the purpose of the 'restrict' keyword in a function definition in C? To indicate that the function returns a restricted value. To declare a restricted function. To indicate that the function uses restricted variables. To define a pointer to a restricted function. Your score isThe average score is 0% 0% Restart quiz