CS 159 Final Exam T/F Questions With
Correct Answers
True - ANSWER A C program begins with a section for preprocessor directive.
True - ANSWER The preprocessor is a part of the compiling process and
prepares your code for the remainder of that process.
True - ANSWER Every program must have exactly one function named main.
True - ANSWER The main function is the starting point for execution of the
program.
True - ANSWER Within each function the local declarations and executable
statements must NOT be permitted to overlap.
True - ANSWER Variable declarations will NEVER be permitted in the global
section this semester.
True - ANSWER The files stdio.h and math.h are libraries that contain standard
functions for our use.
True - ANSWER The return 0; statement will be the final statement in the main
function.
False - ANSWER The return statement in main will return control back to the first
statement in main.
True - ANSWER Comments are added to a program to improve its level of
documentation intended for other programmers.
True - ANSWER The course program headers are multi-line comments.
True - ANSWER You should place a single space between all operators and
operands.
True - ANSWER All variables should be commented to the right of each
declaration.
False - ANSWER You should declare multiple variables on one line.
,True - ANSWER Select meaningful identifiers (names) for all variables in your
program.
True - ANSWER Rarely are single character identifiers considered meaningful
for variables in a program.
True - ANSWER Do not single (or double) space the entire program, use blank
lines when appropriate.
True - ANSWER There is no need to include example output with your
submission.
True - ANSWER All code found between { and } should be indented two
additional spaces.
True - ANSWER The file you submit for lab #1 must be named lab01.c
True - ANSWER Multi-line comments cannot be nested.
True - ANSWER An identifier cannot begin with a digit character.
False - ANSWER In addition to alphabetic and digits characters it is acceptable
to use underscores, dashes, and periods as part of an identifier.
True - ANSWER The data type of a variable will determine the amount of memory
that is necessary to reserve for it.
True - ANSWER The operators that can be applied to a value are restricted by its
data type.
True - ANSWER A variable that is not initialized at the time it is declared will be
storing an unknown value.
True - ANSWER The use of symbolic/defined constants can improve the
documentation of a program.
True - ANSWER In most cases the definition of symbolic/defined constants will
not terminate with a semi-colon.
True - ANSWER A literal constant is data that is not represented by any other
symbol in a given expression.
True - ANSWER A printf function is composed of a format string and a data list.
False - ANSWER A scanf function is composed of a format string and a data list.
, True - ANSWER The selection of a conversion code in a format string depends
on the type of value it will represent.
True - ANSWER A width modifier is used to reserve a given number of spaces to
assist with the alignment of the value being displayed.
False - ANSWER The precision modifier can specify the number of digits to
display yon both sides of the decimal-point with a floating-point value.
False - ANSWER A single scanf function call can be used to display the prompt
for input to the user and accept the input from the user.
True - ANSWER While commonly used in printf function the scanf function would
not make use of the '\n' character.
True - ANSWER The use of literal constants should be minimized and the use of
symbolic/defined constants should be maximized in your program.
True - ANSWER A program that does not compile cannot be successfully
submitted for grading.
True - ANSWER Any compiler warnings remaining in a submission will result in a
loss of points.
True - ANSWER The implementation of advanced concepts, those yet to be
introduced in lecture, is not permitted in an assignment unless otherwise
specified.
True - ANSWER All of the compound assignment operators share the same level
of operator precedence.
True - ANSWER The result of an expression in undefined when it attempts to
modify a single variable more than once.
True - ANSWER A single-type operation will generate a result of that same type.
True - ANSWER When evaluation an operator with mixed-type operands it is the
lower ranked data type that is converted to that of the higher ranked data type.
False - ANSWER The use of a precision modifier when displaying a floating-point
value will result in truncating all digits beyond the specified precision value.
True - ANSWER An explicit type conversion can be used to temporarily alter the
data type in an expression from its declared type.
Correct Answers
True - ANSWER A C program begins with a section for preprocessor directive.
True - ANSWER The preprocessor is a part of the compiling process and
prepares your code for the remainder of that process.
True - ANSWER Every program must have exactly one function named main.
True - ANSWER The main function is the starting point for execution of the
program.
True - ANSWER Within each function the local declarations and executable
statements must NOT be permitted to overlap.
True - ANSWER Variable declarations will NEVER be permitted in the global
section this semester.
True - ANSWER The files stdio.h and math.h are libraries that contain standard
functions for our use.
True - ANSWER The return 0; statement will be the final statement in the main
function.
False - ANSWER The return statement in main will return control back to the first
statement in main.
True - ANSWER Comments are added to a program to improve its level of
documentation intended for other programmers.
True - ANSWER The course program headers are multi-line comments.
True - ANSWER You should place a single space between all operators and
operands.
True - ANSWER All variables should be commented to the right of each
declaration.
False - ANSWER You should declare multiple variables on one line.
,True - ANSWER Select meaningful identifiers (names) for all variables in your
program.
True - ANSWER Rarely are single character identifiers considered meaningful
for variables in a program.
True - ANSWER Do not single (or double) space the entire program, use blank
lines when appropriate.
True - ANSWER There is no need to include example output with your
submission.
True - ANSWER All code found between { and } should be indented two
additional spaces.
True - ANSWER The file you submit for lab #1 must be named lab01.c
True - ANSWER Multi-line comments cannot be nested.
True - ANSWER An identifier cannot begin with a digit character.
False - ANSWER In addition to alphabetic and digits characters it is acceptable
to use underscores, dashes, and periods as part of an identifier.
True - ANSWER The data type of a variable will determine the amount of memory
that is necessary to reserve for it.
True - ANSWER The operators that can be applied to a value are restricted by its
data type.
True - ANSWER A variable that is not initialized at the time it is declared will be
storing an unknown value.
True - ANSWER The use of symbolic/defined constants can improve the
documentation of a program.
True - ANSWER In most cases the definition of symbolic/defined constants will
not terminate with a semi-colon.
True - ANSWER A literal constant is data that is not represented by any other
symbol in a given expression.
True - ANSWER A printf function is composed of a format string and a data list.
False - ANSWER A scanf function is composed of a format string and a data list.
, True - ANSWER The selection of a conversion code in a format string depends
on the type of value it will represent.
True - ANSWER A width modifier is used to reserve a given number of spaces to
assist with the alignment of the value being displayed.
False - ANSWER The precision modifier can specify the number of digits to
display yon both sides of the decimal-point with a floating-point value.
False - ANSWER A single scanf function call can be used to display the prompt
for input to the user and accept the input from the user.
True - ANSWER While commonly used in printf function the scanf function would
not make use of the '\n' character.
True - ANSWER The use of literal constants should be minimized and the use of
symbolic/defined constants should be maximized in your program.
True - ANSWER A program that does not compile cannot be successfully
submitted for grading.
True - ANSWER Any compiler warnings remaining in a submission will result in a
loss of points.
True - ANSWER The implementation of advanced concepts, those yet to be
introduced in lecture, is not permitted in an assignment unless otherwise
specified.
True - ANSWER All of the compound assignment operators share the same level
of operator precedence.
True - ANSWER The result of an expression in undefined when it attempts to
modify a single variable more than once.
True - ANSWER A single-type operation will generate a result of that same type.
True - ANSWER When evaluation an operator with mixed-type operands it is the
lower ranked data type that is converted to that of the higher ranked data type.
False - ANSWER The use of a precision modifier when displaying a floating-point
value will result in truncating all digits beyond the specified precision value.
True - ANSWER An explicit type conversion can be used to temporarily alter the
data type in an expression from its declared type.