C Data Types 1 Questions and Answers

Practice Mode
Showing 10 of 50 questions
Q21
What is the size of "short int" typically?
  • A 1 byte
  • B 2 bytes
  • C 4 bytes
  • D 8 bytes
Answer: Option B
Explanation: short int is typically 2 bytes in size.
Q22
Which data type is used for storing large integers beyond int range?
  • A long
  • B long long
  • C big int
  • D huge int
Answer: Option B
Explanation: long long can store very large integers (typically 64-bit).
Q23
What does "volatile" keyword do?
  • A Prevents optimization
  • B Increases speed
  • C Reduces memory usage
  • D Makes variable constant
Answer: Option A
Explanation: volatile tells compiler that variable may change unexpectedly, preventing optimization.
Q24
Which is the correct declaration for a pointer to an integer?
  • A int ptr
  • B ptr int
  • C int *ptr
  • D *int ptr
Answer: Option C
Explanation: int *ptr is the correct syntax for declaring a pointer to an integer.
Q25
What is the range of "signed short int"?
  • A -128 to 127
  • B 0 to 255
  • C -32,768 to 32,767
  • D 0 to 65,535
Answer: Option C
Explanation: signed short int typically ranges from -32,768 to 32,767.
Q26
Which data type would be best for storing a person's weight?
  • A int
  • B float
  • C char
  • D double
Answer: Option B
Explanation: float is suitable for weight as it can have decimal values.
Q27
What is the purpose of "typedef" in C?
  • A Creates new data types
  • B Creates type aliases
  • C Defines constants
  • D Declares variables
Answer: Option B
Explanation: typedef is used to create aliases for existing data types.
Q28
Which of these is a floating-point data type?
  • A int
  • B char
  • C float
  • D long
Answer: Option C
Explanation: float is one of the floating-point data types in C.
Q29
What is the size of "long long int" typically?
  • A 4 bytes
  • B 8 bytes
  • C 16 bytes
  • D 2 bytes
Answer: Option B
Explanation: long long int is typically 8 bytes (64 bits) in size.
Q30
Which format specifier is used for "double"?
  • A %f
  • B %lf
  • C %d
  • D %Lf
Answer: Option B
Explanation: %lf is used for double in printf/scanf functions.
Questions and Answers for Competitive Exams Various Entrance Test