What is the size of an integer variable in most modern C compilers?
A2 bytes
B4 bytes
C8 bytes
DIt depends on the compiler
Correct Answer:
B. 4 bytes
Explanation:
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.
Which of the following is NOT a valid C data type?
Afloat
Bboolean
Cdouble
Dchar
Correct Answer:
B. boolean
Explanation:
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).
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.
Which keyword is used to create a constant variable in C?
Afinal
Bconstant
Cconst
Dstatic
Correct Answer:
C. const
Explanation:
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.