What is the default storage class for global variables?
A. auto
B. static
C. extern
D. register
Answer: Option C
A. auto
B. static
C. extern
D. register
Answer: Option C
What is the primary purpose of the 'static' storage class?
A. Extend scope
B. Preserve value
C. Allocate memory
D. Register access
What will be the output of the following C code?
#include
void main()
{
int i = 2;
do
{
printf("Hi");
} while (i < 2)
}
A) Compile time error
B) Hi Hi
C) Hi
D) Varies