C Data Types 1 Questions and Answers

Practice Mode
Showing 10 of 50 questions
Q11
What does the "unsigned" modifier do?
  • A Allows only positive numbers
  • B Allows only negative numbers
  • C Increases precision
  • D Decreases size
Answer: Option A
Explanation: unsigned removes the sign bit, allowing only positive numbers and doubling the positive range.
Q12
Which data type provides the highest precision for decimal numbers?
  • A float
  • B double
  • C long double
  • D int
Answer: Option C
Explanation: long double provides the highest precision among floating-point types.
Q13
What is the size of "float" data type in C?
  • A 2 bytes
  • B 4 bytes
  • C 8 bytes
  • D 16 bytes
Answer: Option B
Explanation: float typically occupies 4 bytes of memory.
Q14
Which of the following is a derived data type in C?
  • A int
  • B float
  • C array
  • D char
Answer: Option C
Explanation: Arrays are derived data types constructed from fundamental types.
Q15
What is the range of "unsigned int" on a 32-bit system?
  • A 0 to 65,535
  • B -2,147,483,648 to 2,147,483,647
  • C 0 to 4,294,967,295
  • D 0 to 32,767
Answer: Option C
Explanation: unsigned int ranges from 0 to 4,294,967,295 on 32-bit systems.
Q16
Which format specifier is used for "unsigned long" in C?
  • A %lu
  • B %ul
  • C %ld
  • D %dl
Answer: Option A
Explanation: %lu is used for unsigned long in printf/scanf functions.
Q17
What is the purpose of "void" data type?
  • A Represents empty value
  • B Represents any data type
  • C Represents null pointer
  • D Represents garbage value
Answer: Option A
Explanation: void is used to indicate no type, commonly used for functions that return nothing.
Q18
Which data type would you use for a variable that stores age?
  • A int
  • B unsigned int
  • C float
  • D char
Answer: Option B
Explanation: unsigned int is suitable for age as it cannot be negative.
Q19
What is the difference between "float" and "double"?
  • A double has higher precision
  • B float has higher precision
  • C They are the same
  • D double is smaller in size
Answer: Option A
Explanation: double has higher precision and larger range compared to float.
Q20
Which of the following is a valid character constant?
  • A "A"
  • B 'A'
  • C A
  • D char A
Answer: Option B
Explanation: Single quotes are used for character constants in C, and 'A' is a valid character.
Questions and Answers for Competitive Exams Various Entrance Test