1 1 vote Which of the following is TRUE? A Scope of static variable is within the body of function where it is declared. B Same variable can be declared multiple times within the same function only if it is extern storage class. C Malloc always returns base address of block of memory allocated. D None of the above This is a multiple select question Programming in C programming-in-c made-easy-test-series + – practicalmetal 752 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
2 2 votes Correct Answer is A & C A. "Scope of static variable is within the body of the function where it is declared." This statement is TRUE. The scope of a static variable is limited to the function or block in which it is declared. B. "Same variable can be declared multiple times within the same function only if it is extern storage class." This statement is FALSE. Regardless of the storage class (including extern), redeclaring the same variable within the same function would result in a compilation error. Redeclaring a variable within the same scope is not allowed in C. C. "Malloc always returns the base address of the block of memory allocated." This statement is TRUE. The malloc function in C returns a pointer to the base address of the dynamically allocated memory block.. Therefore, the TRUE statements are A and C. prasantkr.singh answered Jan 10, 2024 prasantkr.singh comment Share Follow 0 reply Please log in or register to add a comment.