Govt Exams
To explicitly declare a function with no parameters in C, use 'void' as the parameter. int func(); is ambiguous in older C standards.
#define is a preprocessor directive used to define symbolic constants (macros) and performs text substitution before compilation.
The arrow operator (->) is used to access structure members through a pointer. The dot operator (.) is used for direct access.
The break statement immediately terminates the loop and transfers control to the statement following the loop.
In C, if a function's return type is not explicitly specified, it defaults to int. However, modern C standards require explicit return type declaration.
Arrays in C are declared with square brackets containing the size, followed by initialization in curly braces. Option A is the correct syntax.
malloc() (memory allocation) allocates a block of memory dynamically during program execution and returns a pointer to it.
A pointer is a variable that stores the memory address of another variable. It is declared using the * symbol.
int x = 10;
int y = 20;
int z = x < y ? x++ : y++;
printf("%d %d %d", x, y, z);
A static variable declared inside a function has local scope (visible only within that function) but persists for the entire program lifetime. Its value is retained between function calls and is initialized only once.