C Data Types 1 Questions and Answers

Practice Mode
Showing 10 of 50 questions
Q41
What is the purpose of "auto" storage class?
  • A Automatic storage
  • B Static storage
  • C Global storage
  • D Register storage
Answer: Option A
Explanation: auto is the default storage class for local variables (usually omitted).
Q42
Which data type is suitable for storing a student's grade point average?
  • A int
  • B char
  • C float
  • D double
Answer: Option C
Explanation: float is suitable for GPA as it requires decimal precision.
Q43
What is the range of "signed int" on a 32-bit system?
  • A -128 to 127
  • B 0 to 255
  • C -32,768 to 32,767
  • D -2,147,483,648 to 2,147,483,647
Answer: Option D
Explanation: signed int ranges from -2,147,483,648 to 2,147,483,647 on 32-bit systems.
Q44
Which data type is used for storing double precision floating-point numbers?
  • A float
  • B double
  • C long double
  • D int
Answer: Option B
Explanation: double is the double precision floating-point type in C.
Q45
What is the size of "char" data type?
  • A 1 byte
  • B 2 bytes
  • C 4 bytes
  • D Depends on system
Answer: Option A
Explanation: char always occupies 1 byte regardless of the system.
Q46
Which of the following is a user-defined data type?
  • A int
  • B float
  • C char
  • D struct
Answer: Option D
Explanation: struct allows users to define their own data types by grouping variables.
Q47
What is the purpose of "static" storage class?
  • A Preserves value
  • B Makes variable global
  • C Increases speed
  • D Reduces size
Answer: Option A
Explanation: static preserves variable value between function calls and limits scope to file/function.
Q48
Which data type would you use for a flag that can be true or false?
  • A bool
  • B boolean
  • C int
  • D flag
Answer: Option C
Explanation: C uses int with 0 for false and non-zero for true as there is no built-in boolean.
Q49
What is the range of "unsigned short int"?
  • A 0 to 255
  • B 0 to 65,535
  • C -32,768 to 32,767
  • D 0 to 4,294,967,295
Answer: Option B
Explanation: unsigned short int ranges from 0 to 65,535.
Q50
Which format specifier is used for "long int"?
  • A %d
  • B %ld
  • C %li
  • D %lld
Answer: Option B
Explanation: %ld is used for long int in printf/scanf functions.
Questions and Answers for Competitive Exams Various Entrance Test