Arizona State University (ASU) CSE240 Introduction to Programming Languages Midterm Practice Exam

Question: 1 / 400

Which of the following is considered a primitive data type in C?

String

bool

float

In the C programming language, a primitive data type refers to the basic types that are built into the language, serving as the foundational blocks for data manipulation. The correct answer, float, is indeed one of these primitive types. Float is used to represent floating-point numbers, which are numbers that have a decimal point and can represent a wide range of values. This allows programmers to work with real numbers in mathematical calculations.

Primitive data types in C also include integer types (such as int and char), and the boolean type, which is technically represented using integers (0 for false and 1 for true in C, although the standard 'bool' type was introduced in C99). However, float is distinctly recognized as a primitive type because it directly supports decimal values and mathematical operations on those values.

String and Array are not primitive data types in C. A string is represented as an array of characters terminated by a null character, making it a composite type rather than a primitive one. An array, while it can hold multiple values, is essentially a collection of items of the same type, and thus it is also considered a derived data type rather than a primitive type.

Get further explanation with Examzify DeepDiveBeta

Array

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy