Datatype in C MCQs Exercise I

Ques 1 Datatype


Which is the following is not primitive datatype ?

A int
B float
C Array
D char

An array, on the other hand, is not a primitive data type. It's a composite data structure that stores a collection of elements of the same data type. Each element in an array has a specific index or position, allowing you to access and manipulate individual elements within the collection. Arrays provide a way to organize and manage multiple related values under a single name.

Ques 2 Datatype


What is the range of the char ?

A -128 to 127
B -127 to 128
C -128 to 0
D -127 to 128

A char data type typically stores signed integers and covers the range from -128 to 127. This holds true across most programming languages. It uses 1 byte of memory, and half of that goes to representing the sign. If you need non-negative values, use unsigned char (ranging from 0 to 255). While some systems might use 2 bytes for char, the standard representation and common range is -128 to 127.

Ques 3 Datatype


What is the range of the char ?

A 2 byte
B 4 byte
C 1 byte
D None of these

The size of a char data type can vary depending on the system and compiler, but it is typically 1 byte. This allows it to represent integer values from -128 to 127. However, some systems might use 2 bytes for char, extending the range to -32768 to 32767. If you need to store unsigned characters (non-negative values), you can use the unsigned char type, which typically has a range of 0 to 255.

Ques 4 Datatype


Which of the following is not a data type in C?

A string
B int
C float
D double

Ques 5 Datatype


What is the range of values that can be stored by an int data type in C?

A -2147483648 to 2147483647
B -32768 to 32767
C -9223372036854775808 to 9223372036854775807
D -1.7976931348623157e+308 to 1.7976931348623157e+308

Ques 6 Datatype


What is the range of values that can be stored by a float data type in C?

A -32768 to 32767
B -2147483648 to 2147483647
C -9223372036854775808 to 9223372036854775807
D -3.4028234663852886e+38 to 3.4028234663852886e+38

Ques 7 Datatype


What is the data type of the following expression: 2 + 3?

A int
B float
C double
D char

Ques 8 Datatype


What is the data type of the following expression: 2.0 + 3.0?

A int
B float
C double
D char

Ques 9 Datatype


What is the data type of the following expression: "Hello, world!"?

A int
B float
C string
D char*