C Data Types 1 Questions and Answers

Practice Mode
Showing 10 of 50 questions
Q31
What is the default sign of "char" data type?
  • A signed
  • B unsigned
  • C Implementation-defined
  • D Always positive
Answer: Option C
Explanation: The default sign of char is implementation-defined (can be signed or unsigned).
Q32
Which data type is used for storing monetary values with precision?
  • A float
  • B double
  • C long double
  • D int
Answer: Option C
Explanation: long double provides the precision needed for monetary calculations.
Q33
What is the purpose of "register" storage class?
  • A Stores in register
  • B Makes variable global
  • C Makes variable constant
  • D Increases size
Answer: Option A
Explanation: register suggests to compiler to store variable in CPU register for faster access.
Q34
Which of the following is NOT a basic data type in C?
  • A int
  • B float
  • C char
  • D string
Answer: Option D
Explanation: string is not a basic data type in C; it is implemented as array of chars.
Q35
What is the range of "unsigned char"?
  • A -128 to 127
  • B 0 to 255
  • C 0 to 127
  • D 0 to 65535
Answer: Option B
Explanation: unsigned char ranges from 0 to 255.
Q36
Which data type would you use for a loop counter?
  • A float
  • B double
  • C int
  • D char
Answer: Option C
Explanation: int is commonly used for loop counters as it is efficient and sufficient for most cases.
Q37
What is the difference between "signed" and "unsigned" integers?
  • A signed can be negative
  • B unsigned is larger
  • C signed is faster
  • D No difference
Answer: Option A
Explanation: signed integers can represent both positive and negative numbers, while unsigned only positive.
Q38
Which data type is used for storing single precision floating-point numbers?
  • A float
  • B double
  • C long double
  • D int
Answer: Option A
Explanation: float is the single precision floating-point type in C.
Q39
What is the size of "long int" on a 64-bit Linux system?
  • A 4 bytes
  • B 8 bytes
  • C 2 bytes
  • D 16 bytes
Answer: Option B
Explanation: long int is typically 8 bytes on 64-bit Linux systems.
Q40
Which format specifier is used for "unsigned int"?
  • A %d
  • B %u
  • C %i
  • D %f
Answer: Option B
Explanation: %u is used for unsigned int in printf/scanf functions.
Questions and Answers for Competitive Exams Various Entrance Test