Govt Exams
C uses C-style casting with parentheses: (type) expression. This converts 5.7 to integer 5.
According to C99 standard, long long int is guaranteed to be at least 8 bytes (64 bits).
static variables are automatically initialized to 0 for numeric types and NULL for pointers if not explicitly initialized.
extern variables have global scope and exist throughout program execution. They can be accessed across multiple files.
long double provides maximum precision (typically 80-128 bits) for decimal numbers compared to float (32 bits) and double (64 bits).
Auto variables (local variables) contain unpredictable garbage values if not initialized. Static/global variables are initialized to 0.
float x = 5 / 2;
printf("%f", x);
5/2 performs integer division (both operands are int), resulting in 2. This is then converted to float as 2.0.
Static variables are automatically initialized to 0 by the compiler.
int x = 10;
int *p = &x;
printf("%d", *p);
p is a pointer to x. *p dereferences the pointer, giving the value of x, which is 10.
static restricts variable visibility to the current file; extern declares a variable defined elsewhere with global scope.