Govt Exams
Both are valid syntax. Option A declares an anonymous structure with immediate variable instantiation. Option B declares a named structure type that can be used later to create variables.
A static variable inside a function is initialized only once and retains its value between successive function calls. It has memory allocated in the data segment, not the stack.
fgets() is the safe way to read strings including spaces. scanf("%s") stops at whitespace, gets() is deprecated and unsafe due to buffer overflow risks.
This is XOR swap algorithm. Step 1: a = 10^20. Step 2: b = (10^20)^20 = 10. Step 3: a = (10^20)^10 = 20. Result: a=20, b=10 (values are swapped).
When a character is printed using %d format specifier, its ASCII value is printed. The ASCII value of 'A' is 65.
The modulus operator % returns the remainder of division. 10 % 3 = 1 (since 10 = 3 × 3 + 1). Therefore, c = 1 and the output is 1.
C supports pass by value and pass by pointer/address. 'Pass by reference' as a concept exists in C++, not in C. In C, to achieve reference-like behavior, we use pointers.
The condition x < y evaluates to true (5 < 10), so the if block executes, printing 'yes'. The else block is skipped.