To declare an enumerated type, we must declare its identifier and its values. (T/F)
T
2
New cards
The computer language that most closely resembles machine language is ____.
Assembly
3
New cards
The "natural" loop for data validation is the do...while because it is a post-test loop. (T/F)
T
4
New cards
Which of the following statements about pointer initialization is true?
The data variable must be declared before it can be used for pointer initialization.
5
New cards
A C function must be both declared and defined. (T/F)
T
6
New cards
A ____ is a construct that allows a portion of memory to be shared by different types of data.
union
7
New cards
It is a good programming style to indent dependent statements. (T/F)
T
8
New cards
In C, if statements cannot be nested.(T/F)
F
9
New cards
Which of the following answers about statements is true?
Statements can be null.
10
New cards
Which of the following statements about arrays in structures is false?
Structures can have only one array within the declaration.
11
New cards
The string-in-string function returns a pointer to a matching sub-string in a string.(T/F)
T
12
New cards
A C program is made up of one or more functions, one of which must be named main. (T/F)
T
13
New cards
Like an array, all of the elements in a structure must be of the same type.(T/F)
F
14
New cards
Given the following code, what is printed? int x;x = 4;printf("%d %d", x, x++);
4 4
15
New cards
To insert a node in a linked list, we only need to know the new nodes logical successor.(T/F)
F
16
New cards
Which of the following statements about string compares is false?
If the two strings are equal, the result is true.
17
New cards
The for statement is a pretest loop that contains three expressions: initialization, limit-test, and process.(T/F)
F
18
New cards
System software manages the hardware resources and performs required information processing tasks.(T/F)
T
19
New cards
A local variable is a variable that is defined inside a function.(T/F)
T
20
New cards
Only fixed-length arrays can be initialized when they are defined.(T/F)
T
21
New cards
Because enumerated types are based on standard numeric types, they can be read and written using the formatted input/output functions.(T/F)
F
22
New cards
The ____ function writes a string to the standard output stream.
puts
23
New cards
An array is a collection of elements of the same data type.(T/F)
T
24
New cards
Which of the following statements about the else-if construct is false?
The else-if is a C construct.
25
New cards
In a post-test loop, if the test is false, no action is taken.(T/F)
F
26
New cards
An expression is a sequence of operands and operators that reduces to a single value.(T/F)
T
27
New cards
Recursion is a repetitive process in which a function calls itself.(T/F)
T
28
New cards
A complex expression contains more than one operand.(T/F)
F
29
New cards
Which of the following is not a step in inserting a node into a linear list?
Set the new nodes link pointer to NULL.
30
New cards
If an integer (int) and a real (float) are multiplied, the result is an integer.(T/F)
F
31
New cards
The size of all pointers is the same.(T/F)
T
32
New cards
Functions cannot be coded in a parameter list.(T/F)
F
33
New cards
Global declarations are found in the declarations section within a function.(T/F)
F
34
New cards
Variables defined with a block have global scope.(T/F)
F
35
New cards
Which of the following expressions uses associativity?
a * b / c
36
New cards
The ____ string function scans a string under the control of a format conversion specification and stores the results in one or more variables.
sscanf
37
New cards
The C language does not verify that an index is valid for an array.(T/F)
T
38
New cards
A linked list must always have a last pointer.(T/F)
F
39
New cards
The application design tool that is a visual representation of the logic in a function within a program is the ____.
Flowchart
40
New cards
A for loop is used when a loop is to be executed a known number of times.(T/F)
T
41
New cards
As long as the types are the same, one array can be copied to another using the assignment operator.(T/F)
F
42
New cards
The value of the expression 2 + 3 * 4 is 20.(T/F)
F
43
New cards
The major deficiency in an array implementation of a list is that searching and retrieval are slow.(T/F)
F
44
New cards
A ____ is a construct that creates a type that can be used to define objects.
structure (struct)
45
New cards
When we pass an address to a function, we are actually passing a pointer to a variable.(T/F)
T
46
New cards
The ____ operator is used to extract the address for a variable.
address (&)
47
New cards
A ____ consists only of a function header.
function declaration
48
New cards
Which of the following statements about evaluating binary logical expressions is false?
For efficiency, it is a good programming style to use side effects in binary expressions.
49
New cards
A computer system consists of hardware and ____.
software
50
New cards
Which of the following statements is not a looping construct?
switch
51
New cards
The value of the modulus binary expression is a remainder.(T/F)
T
52
New cards
Which of the following array initialization statements is valid?
int ary [5] = {1, 2, 3};
53
New cards
To delete a node, we must first locate it.(T/F)
T
54
New cards
A pointer is a constant or variable that contains an address that can be used to access data.(T/F)
T
55
New cards
An address expression consists of an ampersand (&) and a variable name.(T/F)
T
56
New cards
Given a is 3, b is 4, and c is 5, what is the value of the expression--a * (3 + b) / 2 - c++ * b?
-13
57
New cards
A function call is a postfix expression.(T/F)
T
58
New cards
Because addresses are pointer constants, pointers cannot be initialized.(T/F)
F
59
New cards
Enumerated types can be added, subtracted, multiplied, and divided.(T/F)
T
60
New cards
C has only three loop statements.(T/F)
T
61
New cards
In C, data is input to and output from a stream.(T/F)
T
62
New cards
Which of the following statements about nested structures is false?
Before a structure can be nested, it must be declared.
63
New cards
C is a structured programming language.(T/F)
T
64
New cards
Because C passes an array to a function using its address, it is not possible to prevent the called function from changing the values in the array.(T/F)
F
65
New cards
A count loop must be written with a for statement; it cannot be written using a while loop.(T/F)
F
66
New cards
The parameters in a function definition must have a type and a name.(T/F)
T
67
New cards
In a linked list, the elements are called headers.(T/F)
F
68
New cards
Structures may contain pointers.(T/F)
T
69
New cards
A stack is also known as a FIFO data structure.(T/F)
F
70
New cards
A ____ is a variable that is defined inside a function and used without having any role in the communication between functions.
local variable
71
New cards
Traditionally, lists are implemented using either arrays or pointers.(T/F)
T
72
New cards
Which of the following statements about the syntax for the if-else statement is false?
The if-else is terminated with a semicolon.
73
New cards
Which of the following is not required in general-list insertion?
Insert a duplicate key.
74
New cards
Variables are not initialized automatically.(T/F)
T
75
New cards
One programming technique used to simplify long, complex expressions is to use braces.(T/F)
F
76
New cards
While the address of a variable is constant, the address stored in a pointer variable can be changed.(T/F)
T
77
New cards
The tool used by a programmer to convert a high-level source program to an object module is a ____.
Compiler
78
New cards
The else in an if...else statement is always required.(T/F)
F
79
New cards
C uses fixed-length, delimited strings.(T/F)
F
80
New cards
A table is a two-dimensional array of rows and columns.(T/F)
T
81
New cards
If the number of values provided in the initializer is fewer than the number of elements in the array, the unassigned elements are filled with zeros.(T/F)
T
82
New cards
Which of the following I/O functions cannot be used to read a string from a file?
sscanf
83
New cards
A pointer that is currently pointing to no variable contains the null-pointer constant, NULL.(T/F)
T
84
New cards
Any expression can be used in the switch statement.(T/F)
F
85
New cards
As long as they are identically declared, including their length, one string may be assigned to another.(T/F)
F
86
New cards
The only formatted string input/output conversion code is "%s".(T/F)
F
87
New cards
Which of the following statements passes a pointer to a variable to a function?
fun (&x);
88
New cards
The C logical operators are not, and, and or.(T/F)
T
89
New cards
A type definition gives a name to a data type by creating a new type.(T/F)
T
90
New cards
Which of the following is the complement of equal ( ==)?
!=
91
New cards
Block comments may span several lines.(T/F)
T
92
New cards
A three-dimensional array consists of planes, rows, and columns.(T/F)
T
93
New cards
Fixed-length strings are terminated by a delimiter.(T/F)
F
94
New cards
In a counter-controlled loop, we always add to a counter to determine when to terminate the loop.(T/F)
F
95
New cards
Nodes in a linked list are self-referential because each instance of a node contains one or more pointers to other instances of the same node type.(T/F)
T
96
New cards
C uses an index to access the individual elements in an array.(T/F)
T
97
New cards
In general, a string is a series of characters treated as a unit.(T/F)
T
98
New cards
The while loop is a post-test loop.(T/F)
F
99
New cards
C always pairs an else statement to the most recent unpaired if statement in the current block.(T/F)
T
100
New cards
A C function can have no parameters and still return a value.(T/F)