C Language Quiz (Set 6) C Language (Set 6) 1 / 10 What is the purpose of the 'offsetof' macro in C? To calculate the size of a data structure. To include a header file. To calculate the difference between two pointers. To determine the position of a field within a structure. 2 / 10 Which C library function is used to convert a string to a floating-point number? strtof strfloat strflt floattostr 3 / 10 What is the purpose of the 'exit' function in C? To terminate a loop. To close an open file. To return a value from a function. To exit the program immediately. 4 / 10 Which C library function is used to convert an integer to a string? itoa inttostr int2str integerstr 5 / 10 What is the purpose of the 'do-while' loop in C? To create an infinite loop. To repeat a block of code as long as a condition is true. To iterate over elements of an array. To execute a block of code at least once before checking a condition. 6 / 10 In C, what is the purpose of the 'wchar_t' data type? To store wide characters. To store integer values. To store floating-point values. To represent time and date. 7 / 10 What is the purpose of the 'volatile' keyword when used in a function prototype in C? To indicate that the function returns a volatile value. To declare a volatile function. To indicate that the function uses volatile variables. To define a pointer to a volatile function. 8 / 10 Which C library function is used to compare two memory blocks? memcompare memcmp comparemem memorycmp 9 / 10 What is the result of the expression '5 << 2' in C? 20 8 10 25 10 / 10 What is the purpose of the 'const' keyword when used in a function prototype in C? To declare a constant variable. To indicate that the function does not modify its arguments. To create a pointer to a constant variable. To define a constant function. Your score isThe average score is 0% 0% Restart quiz