Govt Exams
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.
The break statement terminates the current loop or switch block and transfers control to the statement following the loop or switch. Without it, execution continues to the next case (fall-through).
malloc() is the standard C library function for dynamic memory allocation. It returns a void pointer to the allocated memory block, which can be cast to the required data type.
sizeof(arr) returns the total size of the array in bytes. An array of 5 integers, where each int is 4 bytes, equals 5 × 4 = 20 bytes.
The stdio.h header file contains declarations for standard input/output functions like printf(). Option A is C++, Option C is C++, and Option D is for memory allocation functions.
Following operator precedence: 3*4=12, 5/2=2 (integer division), 2+12=14, 14-2=12. Actually x = 2 + 12 - 2 = 12. Let me recalculate: 2 + (3*4) - (5/2) = 2 + 12 - 2 = 12. Wait: 2 + 12 - 2 = 12, not 13. The answer should be D.
The %d format specifier prints the ASCII value of the character. 'A' has ASCII value 65.
The == operator compares values. Since a and b both have value 5, the condition is true and "Equal" is printed.
getchar() reads a single character from standard input (stdin) and returns its ASCII value.