Govt. Exams
Entrance Exams
Parentheses have the highest precedence in C. Expressions within parentheses are evaluated first, followed by arithmetic operators, then logical operators, and finally assignment operators.
The stdio.h (Standard Input Output) header file contains declarations for printf(), scanf(), and other input/output functions. It is essential for console I/O operations.
In a 32-bit system, the int data type typically occupies 4 bytes (32 bits). This is the standard size for integer types on most 32-bit architectures.
The += operator is a compound assignment operator. x += 3 is equivalent to x = x + 3. Therefore, 5 + 3 = 8.
for(int i = 0; i < 5; i++)
The loop initializes i to 0 and continues while i < 5. Values of i: 0, 1, 2, 3, 4. After i becomes 5, the condition is false, so the loop executes 5 times.
By the C standard, sizeof(char) is always 1 byte. A char is the smallest addressable unit in C and is defined to be 1 byte.
The const keyword is used in C to declare a constant variable whose value cannot be modified after initialization. Variables declared as const are read-only.
The & operator has two uses in C: (1) When used before a variable, it returns the memory address of that variable (address-of operator), and (2) When used between two integers, it performs a bitwise AND operation.
C does not have a built-in boolean data type. The other options (float, double, char) are all valid primitive data types in C. Boolean functionality is typically implemented using int (0 for false, non-zero for true).
On most modern 32-bit and 64-bit systems, an int is typically 4 bytes (32 bits). However, the exact size can vary depending on the compiler and system architecture.