Deck 3: Processing and Interactive Input

Full screen (f)
exit full mode
Question
In C, the assignment operator has the highest precedence of all the binary and unary arithmetic operators.
Use Space or
up arrow
down arrow
to flip the card.
Question
The cast operator is a binary operator.
Question
An rvalue refers to any quantity that is valid on the right side of an assignment operator.
Question
The automatic conversion across an assignment operator is referred to as an implicit type conversion.
Question
A special type of assignment statement that is very similar to the accumulating statement is the counting statement.
Question
When the -- operator appears before a variable, it is called a postfix decrement operator.
Question
When the -- operator appears after a variable, it is called a prefix decrement operator.
Question
Robust programs are informally known as "bullet-proof" programs.
Question
The format of numbers displayed by printf() can be controlled by field width specifiers included as part of each conversion control sequence.
Question
C provides the programmer with the capability to define a value (that will be used throughout a program) once by equating the number to a symbolic name.
Question
In C, the equal sign has the same meaning as an equal sign in algebra.
Question
In addition to being a constant, the operand to the right of the equal sign in an assignment statement can be a variable or any valid C expression.
Question
The expression amount + 1892 = 1000 + 10 * 5 is valid in C.
Question
Data type conversions take place across assignment operators.
Question
=+ is a valid C operator.
Question
In C, log(x) yields the common log of x (base 10).
Question
A function can be regarded as a "black box," where the arguments constitute the inputs to the box.
Question
The argument to the sqrt function must be an integer value.
Question
The arguments passed to a mathematical function must be single constants.
Question
The returned value of a function may not be used as an argument to another function.
Question
The control string passed to scanf() typically consists of conversion control sequences only.
Question
The scanf() function tests the data type of the values being entered.
Question
The fflush() function flushes the input buffer of any remaining characters.
Question
The order of the format modifiers in printf() is not critical.
Question
The statement variable = variable + 1; is equivalent to variable++;.
Question
The cast operator has the syntax ____.

A)(dataType expression)
B)(expression dataType)
C)(dataType) expression
D)expression (dataType)
Question
In C, the ____ symbol is called the assignment operator.

A)=
B)++
C)--
D)()
Question
The term ____ refers to any quantity that is valid on the left side of an assignment operator.

A)leftv
B)lval
C)variable
D)lvalue
Question
A previously stored number, if it has not been initialized to a specific and known value, is frequently referred to as a ____.

A)garbage value
B)literal
C)bogus value
D)buffer
Question
When the ++ operator appears after a variable, it is called a ____ increment operator.

A)basic
B)standard
C)postfix
D)prefix
Question
A(n) ____ is a message that tells the person at the screen what should be typed.

A)prompt
B)input statement
C)scanf
D)printf
Question
On most computer systems characters read by the keyboard are stored in a temporary holding area called a ____ immediately after they are pressed.

A)register
B)buffer
C)stack
D)RAM
Question
Programs that detect and respond effectively to unexpected user input are formally referred to as ____ programs.

A)standard
B)robust
C)cost-effective
D)abstract
Question
Literal values that appear many times in the same program are referred to by programmers as ____ numbers.

A)symbolic
B)magic
C)constant
D)literal
Question
____ statements are also called equivalence statements.

A)Assignment
B)Prompt
C)#include
D)#define
Question
____ is a valid statement in C.

A)a = 10 = c = 25;
B)a = b = c = 25;
C)2 = b;
D)a - 1 = c;
Question
Which of the following statements about rvalues and lvalues is NOT true?

A)Any expression that yields a value can be an rvalue.
B)A variable declared for an array cannot be an rvalue, but individual array variables can be.
C)A variable declared for an array can be an lvalue.
D)Individual numbers can only be an rvalue.
Question
The statement ____ shows an implicit conversion.

A)int total = (int) sum;
B)double avg = 0.0;
C)float price = 9.90f;
D)int answer = 2.745;
Question
The expression sum = sum + 10 can be written as ____.

A)sum =+ 10
B)sum += 10
C)sum = sum ++ 10
D)sum ++ 10
Question
The expression price *= rate + 1 is equivalent to the expression ____.

A)price = price (rate + 1)
B)price = price rate + 1
C)price = (price rate) + 1
D)price = price ^ (rate + 1)
Question
The C function ____ yields the result of a value raised to the power of another value.

A)pow
B)exp
C)abs
D)sqrt
Question
To access the mathematical functions such as log and sqrt, you must include the following preprocessor statement in your program: ____.

A)#define
B)#include
C)#define
D)#include
Question
If you are using a Unix or Linux operating system, you must include the ____ option when compiling a C program that uses the mathematical functions like log and sqrt.

A)-lm
B)-l math.h
C)-math
D)-lib = math
Question
The ____ function requires a control string as the first argument inside the function name parentheses.

A)sqrt()
B)pow()
C)scanf()
D)log()
Question
Formatted floating-point numbers require ____ field width specifier(s).

A)one
B)two
C)three
D)four
Question
Format modifiers, if used, must always be placed immediately after the ____ symbol.

A)!
B)=
C)%
D))
Question
The conversion control sequence ____ would cause an integer number to both display its sign and be left-justified in a field width of 10 spaces.

A) %-+10d
B) %-10d
C) %+10d
D) %*10d
Question
The ____ sign is a signal to a C preprocessor.

A) !
B) &
C) ;
D) #
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/48
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Processing and Interactive Input
1
In C, the assignment operator has the highest precedence of all the binary and unary arithmetic operators.
False
2
The cast operator is a binary operator.
False
3
An rvalue refers to any quantity that is valid on the right side of an assignment operator.
True
4
The automatic conversion across an assignment operator is referred to as an implicit type conversion.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
5
A special type of assignment statement that is very similar to the accumulating statement is the counting statement.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
6
When the -- operator appears before a variable, it is called a postfix decrement operator.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
7
When the -- operator appears after a variable, it is called a prefix decrement operator.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
8
Robust programs are informally known as "bullet-proof" programs.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
9
The format of numbers displayed by printf() can be controlled by field width specifiers included as part of each conversion control sequence.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
10
C provides the programmer with the capability to define a value (that will be used throughout a program) once by equating the number to a symbolic name.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
11
In C, the equal sign has the same meaning as an equal sign in algebra.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
12
In addition to being a constant, the operand to the right of the equal sign in an assignment statement can be a variable or any valid C expression.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
13
The expression amount + 1892 = 1000 + 10 * 5 is valid in C.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
14
Data type conversions take place across assignment operators.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
15
=+ is a valid C operator.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
16
In C, log(x) yields the common log of x (base 10).
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
17
A function can be regarded as a "black box," where the arguments constitute the inputs to the box.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
18
The argument to the sqrt function must be an integer value.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
19
The arguments passed to a mathematical function must be single constants.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
20
The returned value of a function may not be used as an argument to another function.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
21
The control string passed to scanf() typically consists of conversion control sequences only.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
22
The scanf() function tests the data type of the values being entered.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
23
The fflush() function flushes the input buffer of any remaining characters.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
24
The order of the format modifiers in printf() is not critical.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
25
The statement variable = variable + 1; is equivalent to variable++;.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
26
The cast operator has the syntax ____.

A)(dataType expression)
B)(expression dataType)
C)(dataType) expression
D)expression (dataType)
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
27
In C, the ____ symbol is called the assignment operator.

A)=
B)++
C)--
D)()
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
28
The term ____ refers to any quantity that is valid on the left side of an assignment operator.

A)leftv
B)lval
C)variable
D)lvalue
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
29
A previously stored number, if it has not been initialized to a specific and known value, is frequently referred to as a ____.

A)garbage value
B)literal
C)bogus value
D)buffer
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
30
When the ++ operator appears after a variable, it is called a ____ increment operator.

A)basic
B)standard
C)postfix
D)prefix
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
31
A(n) ____ is a message that tells the person at the screen what should be typed.

A)prompt
B)input statement
C)scanf
D)printf
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
32
On most computer systems characters read by the keyboard are stored in a temporary holding area called a ____ immediately after they are pressed.

A)register
B)buffer
C)stack
D)RAM
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
33
Programs that detect and respond effectively to unexpected user input are formally referred to as ____ programs.

A)standard
B)robust
C)cost-effective
D)abstract
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
34
Literal values that appear many times in the same program are referred to by programmers as ____ numbers.

A)symbolic
B)magic
C)constant
D)literal
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
35
____ statements are also called equivalence statements.

A)Assignment
B)Prompt
C)#include
D)#define
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
36
____ is a valid statement in C.

A)a = 10 = c = 25;
B)a = b = c = 25;
C)2 = b;
D)a - 1 = c;
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following statements about rvalues and lvalues is NOT true?

A)Any expression that yields a value can be an rvalue.
B)A variable declared for an array cannot be an rvalue, but individual array variables can be.
C)A variable declared for an array can be an lvalue.
D)Individual numbers can only be an rvalue.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
38
The statement ____ shows an implicit conversion.

A)int total = (int) sum;
B)double avg = 0.0;
C)float price = 9.90f;
D)int answer = 2.745;
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
39
The expression sum = sum + 10 can be written as ____.

A)sum =+ 10
B)sum += 10
C)sum = sum ++ 10
D)sum ++ 10
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
40
The expression price *= rate + 1 is equivalent to the expression ____.

A)price = price (rate + 1)
B)price = price rate + 1
C)price = (price rate) + 1
D)price = price ^ (rate + 1)
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
41
The C function ____ yields the result of a value raised to the power of another value.

A)pow
B)exp
C)abs
D)sqrt
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
42
To access the mathematical functions such as log and sqrt, you must include the following preprocessor statement in your program: ____.

A)#define
B)#include
C)#define
D)#include
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
43
If you are using a Unix or Linux operating system, you must include the ____ option when compiling a C program that uses the mathematical functions like log and sqrt.

A)-lm
B)-l math.h
C)-math
D)-lib = math
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
44
The ____ function requires a control string as the first argument inside the function name parentheses.

A)sqrt()
B)pow()
C)scanf()
D)log()
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
45
Formatted floating-point numbers require ____ field width specifier(s).

A)one
B)two
C)three
D)four
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
46
Format modifiers, if used, must always be placed immediately after the ____ symbol.

A)!
B)=
C)%
D))
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
47
The conversion control sequence ____ would cause an integer number to both display its sign and be left-justified in a field width of 10 spaces.

A) %-+10d
B) %-10d
C) %+10d
D) %*10d
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
48
The ____ sign is a signal to a C preprocessor.

A) !
B) &
C) ;
D) #
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 48 flashcards in this deck.