Which of the following is NOT a fundamental data type in C?
Answer: C
C has 5 fundamental data types: int, float, double, char, and void. 'string' is not a fundamental type; it's created using char arrays.
Q.2Easy
What is the size of an 'int' variable in a 32-bit system?
Answer: B
In a 32-bit system, an int is typically 4 bytes (32 bits). However, the C standard only guarantees it's at least 2 bytes, so technically it's compiler-dependent. But in practice, 4 bytes is standard.
Q.3Easy
Which variable declaration is correct in C?
Answer: C
Variable names must start with a letter or underscore, followed by letters, digits, or underscores. Option C follows this rule correctly.
Q.4Easy
Which keyword is used to declare a variable that cannot be modified?
Answer: B
'const' keyword makes a variable constant and immutable after initialization.
Q.5Easy
Which of the following is a derived data type in C?
Answer: B
Derived data types are created from fundamental types. Arrays, pointers, structures, and unions are derived types.
Advertisement
Q.6Easy
How many bits are used to store a 'short int' in a standard C environment?
Answer: B
Standard C guarantees short int is at least 16 bits (2 bytes). Most systems use exactly 16 bits.
Q.7Easy
What is the range of values for a signed char in C?
Answer: B
A signed char occupies 1 byte (8 bits). With sign bit, it ranges from -128 to 127 (2^7 to 2^7-1).
Q.8Easy
Which keyword is used to modify a variable so that it cannot be changed?
Answer: B
The const keyword makes a variable read-only after initialization. Its value cannot be modified during program execution.
Q.9Easy
What is the size of the double data type in most 64-bit systems?
Answer: B
In standard C on 64-bit systems, double occupies 8 bytes and can store values with approximately 15-17 significant digits.
Q.10Easy
Which of the following variable names is INVALID in C?
Answer: C
Variable names cannot start with a digit in C. Valid names must begin with a letter (a-z, A-Z) or underscore (_).
Q.11Easy
What will be the result of sizeof(int) on a typical 32-bit system?
Answer: B
On 32-bit systems, int is typically 4 bytes (32 bits). However, the exact size is implementation-defined per C standard.
Q.12Easy
What is the default data type of a floating-point constant in C?
Answer: B
In C, floating-point constants like 3.14 are treated as double by default. To specify float, you need to use 3.14f suffix.
Q.13Easy
What is the range of unsigned char in C?
Answer: B
unsigned char is 1 byte (8 bits) without sign bit, giving range 0 to 2^8-1 = 0 to 255.
Q.14Easy
What is the scope of a variable declared inside a function block?
Answer: C
Variables declared inside a block (including function blocks) have block scope and are accessible only within that block.
Q.15Easy
Which of the following is a storage class in C?
Answer: C
The storage classes in C are: auto, register, static, and extern. 'static' is one of them.
Q.16Easy
What is the difference between initialization and assignment in C?
Answer: B
Initialization assigns a value when the variable is declared (int x = 5;). Assignment changes the value later (x = 10;).
Q.17Easy
What is the size of a 'float' data type in C on most 32-bit systems?
Answer: B
On most 32-bit systems, float occupies 4 bytes (32 bits) of memory according to IEEE 754 standard.
Q.18Easy
What is the range of 'signed char' in C?
Answer: B
Signed char uses 8 bits with one bit for sign, giving range -128 to 127 (2^7 to 2^7-1).
Q.19Easy
What happens if you assign a double value to an int variable without casting?
Answer: B
Implicit conversion truncates decimal part. int x = 3.7; results in x=3 with no error.
Q.20Easy
What is the size of the 'char' data type in C on most modern systems?
Answer: A
The 'char' data type occupies 1 byte (8 bits) of memory on virtually all modern C systems, as per the C standard.