C Language Quiz (Set 7) C Language (Set 7) 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 a long integer? strtoli strlong longtostr strtol 3 / 10 What is the purpose of the 'atexit' function in C? To terminate the program. To close all open files. To register a function to be called when the program exits. To return a value from a function. 4 / 10 Which C library function is used to copy a memory block to another location? memmove copymem memcopy moveblock 5 / 10 What is the purpose of the 'break' statement in C? To end the loop and continue to the next iteration. To skip the current iteration and continue to the next one. To exit the loop immediately. To pause the loop temporarily. 6 / 10 In C, what is the purpose of the 'ptrdiff_t' data type? To store pointer differences. To store floating-point values. To store integer values. To represent time differences. 7 / 10 What is the purpose of the 'volatile' keyword when used in a structure declaration in C? To declare a volatile structure. To indicate that the structure members are volatile variables. To create a pointer to a volatile structure. To define a structure with volatile memory allocation. 8 / 10 Which C library function is used to search for a substring in a string? searchstr substringsearch strstr findsub 9 / 10 What is the result of the expression '10 / 3' in C? 3.33 3 3.0 3.5 10 / 10 What is the purpose of the 'restrict' keyword in a function prototype 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