Questions: Primitive Data Types

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A programmer writes `result = 7 / 2` in a language where both 7 and 2 are integers. What is the value of `result`?

A3.5
B3
C4
DThis is a syntax error — you cannot divide two integers
Question 2 Multiple Choice

A language that infers a variable's type from the assigned value and checks type rules when operations execute is called:

AStatically typed
BDynamically typed
CWeakly typed
DPolymorphic
Question 3 True / False

In most programming languages, the expression `0.1 + 0.2` evaluates to exactly `0.3`.

TTrue
FFalse
Question 4 True / False

Booleans in modern typed languages are simply a special name for the integers 0 and 1.

TTrue
FFalse
Question 5 Short Answer

Why does the type of a value matter in programming, beyond just labeling it? Give a concrete example of a type affecting what an operation produces.

Think about your answer, then reveal below.