Accounting
Anthropology
Archaeology
Art History
Banking
Biology & Life Science
Business
Business Communication
Business Development
Business Ethics
Business Law
Chemistry
Communication
Computer Science
Counseling
Criminal Law
Curriculum & Instruction
Design
Earth Science
Economic
Education
Engineering
Finance
History & Theory
Humanities
Human Resource
International Business
Investments & Securities
Journalism
Law
Management
Marketing
Medicine
Medicine & Health Science
Nursing
Philosophy
Physic
Psychology
Real Estate
Science
Social Science
Sociology
Special Education
Speech
Visual Arts
Programming Language
Q:
Indentation in the if selection statement is ________.
(a) always mandatory
(b) always optional
(c) only mandatory if there is more than one statement following the if statement
(d) only optional if there is more than one statement following the if statement
Q:
If grade has the value of 60 what will the following code print?
if (grade >= 60) {
puts("Passed");
}
(a) nothing
(b) 60
(c) Passed
(d) puts("Passed");
Q:
Any C program we"ll ever need to build can be constructed from only __________ different control statements combined in only __________ ways.
a) 7, 3
b) 6, 2
c) 7, 2
d) 6, 3
Q:
Which statement is true?
a) Each of C's control statements is characterized as being single-entry, single-exit.
b) Each of C's control statements is characterized as being single-entry, multiple-exit.
c) Each of C's control statements is characterized as being multiple-entry, single-exit.
d) Each of C's control statements is characterized as being multiple-entry, multiple-exit.
Q:
Which is not a C iteration statement?
a) while
b) dowhile
c) for
d) dofor
Q:
The __________ is called a multiple selection statement.
a) if
b) when
c) if else
d) switch
Q:
The __________ is called a double selection statement.
a) if
b) when
c) if else
d) switch
Q:
The __________ is called a single-selection statement.
a) if
b) when
c) ifelse
d) switch
Q:
The __________ selection statement performs one of many different actions, depending on the value of an expression.
a) if
b) when
c) ifelse
d) switch
Q:
The __________ selection statement performs an action if a condition is true and performs a different action if the condition is false.
a) if
b) when
c) ifelse
d) switch
Q:
The __________ selection statement performs an action if a condition is true and skips that action if the condition is false.
a) if
b) when
c) if else
d) switch
Q:
The diamond flowcharting symbol is also called the __________ symbol.
a) determination
b) derision
c) declarative
d) decision
Q:
Small circle symbols in a flowchart are often called __________ symbols.
a) little circle
b) collision
c) connector
d) collator
Q:
Flowchart symbols are connected by arrows called __________.
a) flowlines
b) flow of control
c) flow delimiters
d) darts
Q:
The __________ flowchart symbol is also called the action symbol.
a) small circle
b) diamond
c) rounded rectangle
d) rectangle
Q:
Which statement is true?
a) Unless directed otherwise, the computer automatically executes C statements one before the other.
b) The sequence structure is essentially built into C.
c) A flowchart is a pseudocode representation of an algorithm or a portion of an algorithm.
d) Like pseudocode, flowcharts are useful for developing and representing algorithms, although flowcharts are preferred by most programmers.
Q:
Bohm and Jacopini's work demonstrated that all programs could be written in terms of only three control statements, namely sequence, __________ and iteration.
a) selection
b) serialization
c) sorting
d) searching
Q:
Various C statements enable you to specify that the next statement to be executed may be other than the next one in sequence. This is called __________.
a) change of order
b) instruction skipping
c) transfer of control
d) rerouting
Q:
Normally, statements in a program are executed one after the other in the order in which they are written. This is called __________ execution.
a) inline
b) seeking
c) ordered
d) sequential
Q:
How many types of control statements exist in C?
(a) 3
(b) 7
(c) 5
(d) 2
Q:
Which of the following is an iteration statement?
(a) if
(b) ifelse
(c) dowhile
(d) switch
Q:
In a flowchart of an algorithm, what is the shape of the decision symbol?
(a) circle
(b) rectangle
(c) diamond
(d) rounded rectangle
Q:
Which of the following encompasses the other three?
(a) sequence structure
(b) iteration structure
(c) control structure
(d) selection structure
Q:
Which statement is false?
a) Pseudocode helps you "think out" a program before attempting to write it in a programming language such as C.
b) Pseudocode programs consist purely of characters so programmers may conveniently type pseudocode programs into a computer using an editor program.
c) A carefully prepared pseudocode program is only a beginning; it still takes a tremendous amount of work to convert a pseudocode program into a C program.
d) Pseudocode consists only of action statements.
Q:
Which statement is false?
a) Pseudocode is an artificial and informal language that helps you develop algorithms.
b) Pseudocode is similar to everyday English.
c) Pseudocode is an actual programming language.
d) Pseudocode programs are not actually executed on computers.
Q:
Pseudocode does not typically include __________.
(a) definitions
(b) input/output
(c) action statements
(d) control statements
Q:
Which of the following is true of pseudocode programs?
(a) they are executed by the computer
(b) they help the programmer "think out" a program
(c) they typically include definitions and all types of statements
(d) all of the above are false
Q:
. The two key attributes of an algorithm are:
a) actions and start activity
b) flow and order of flow
c) actions and order of actions
d) flow and start activity
Q:
Specifying the order in which statements are to be executed in a computer program is called
(a) an algorithm
(b) transfer of control
(c) program control
(d) pseudocode
Q:
Which of the following statements should be used in secure C programming to display the string "Welcome" not followed by a newline character?
(a) printf( "Welcome" );
(b) puts( "Welcome" );
(c) printf( "%s", "Welcome" );
(d) None of the above.
Q:
Which of the following statements is true in secure C programming?
(a) You should avoid using printf to display a single string argument.
(b) You should always use printf to display a single string argument.
(c) You should always use puts to display a single string argument.
(d) None of the above.
Q:
The order in which statements are __________ is called flow of control.
a) entered in a source file
b) preprocessed
c) compiled
d) executed
Q:
Which statement is false?
a) The assignment operator associates from left to right.
b) The arithmetic operators associate from left to right.
c) The equality operators associate from left to right.
d) The relational operators associate from left to right.
Q:
Which of the following is not a keyword?
a) int
b) return
c) if
d) main
Q:
Which statement is false?
a) It is not correct to split an identifier with a space, a tab or a newline.
b) Statements and comments may be split over several lines.
c) The equals sign (=) is not an operator.
d) A good programming practice is to break a line after a comma in a lengthy comma-separated list.
Q:
Which statement is false?
a) Whitespace characters such as tabs, newlines and spaces are generally ignored by the C compiler.
b) The statements in an if statement must be indented.
c) Placing a blank line before and after every control structure can improve program readability.
d) There can be (but should not be) more than one statement per line.
Q:
Which statement is false?
a) Executable C statements either perform actions or make decisions.
b) If the condition in an if statement is met, the statement in the body of the if statement is executed.
c) All the relational operators have the same level of precedence.
d) The equality operators have a higher level of precedence than the relational operators.
Q:
Which of the following is an equality operator?
(a) ==
(b) =
(c) >
(d) >=
Q:
C's if statement executes the statement inside its body if a specified __________ is __________.
(a) condition, true
(b) condition, false
(c) equality operator, true
(d) relational operator, true
Q:
Which expression is true?
a) The expression a * (b + c) + c * (d + e) contains nested parentheses.
b) The expression y = a * x * x + b * x + cdoes exponentiation without an exponentiation operator.
c) The C standard library provides function power to perform exponentiation.
d) When we say evaluation of an expression proceeds from left to right we are referring to the additivity of the operators.
Q:
Which statement about precedence is false?
a) Parentheses may be used to force the order of evaluation to occur in any sequence desired by the programmer.
b) Nested, or embedded parentheses are evaluated last.
c) Multiplication has a higher precedence than addition.
d) Subtraction has a lower precedence than division.
Q:
a * ( b + c ) may also be written in C as
a) ab + ac
b) (a * b ) + c
c) a * b + c
d) a * b + a * c
Q:
Which statement about C arithmetic is false?
a) 6 / 3 yields 2
b) 5 / 2 yields 2.
c) 7 % 3 yields 1
d) 6 % 3 yields 0
Q:
Which statement is false?
a) In algebra, we write ab to multiply a times b.
b) In C, we write ab to multiply a times b.
c) In C, the remainder operator is %.
d) In C, integer division yields an integer result.
Q:
Evaluate the expression
3 * 4 % 6 + 4 * 5
(a) 20
(b) 26
(c) 12
(d) 32
Q:
Which operation will find the remainder when 15 is divided by 6?
(a) 15 / 6
(b) 15 % 6
(c) 15 ^ 6
(d) 15 * 6
Q:
Which of the following is false?
a) Reading a value into a memory location destroys the previous value.
b) Reading a value out of a memory location destroys that value.
c) sum = integer1 + integer2; involves destructive read-in.
d) The statement in part c) also involves nondestructive read-out.
Q:
Every variable has all the attributes below, except
a) name
b) value
c) alias
d) type
Q:
When a number gets assigned to a variable that already has a value __________.
(a) the new number overwrites the previous value at that memory location
(b) the new number gets assigned to a neighboring memory location
(c) the computer issues an error
(d) the new value is destroyed and the old value remains
Q:
Variable names actually correspond to __________.
(a) locations in the computer's memory
(b) operators
(c) integers
(d) data types
Q:
Which of the following is false?
a) Each variable being input in a scanf statement is generally preceded by an &.
b) Each variable being output in a printf statement is generally not preceded by an &.
c) In a printf statement, the comma that separates the format control string from the expressions to be printed is placed inside the format control string.
d) Calculations can be performed inside printf statements.
Q:
Which statement is false?
a) in the statement
sum = integer1 + integer2;
both = and + are binary operators.
b) The statement in part a) is an example of an assignment statement.
c) The spaces around each of the binary operators in the statement of part a) are required.
d) In part a), the = operator's two operands are sum and the value of the expression integer1 + integer2.
Q:
The address operator is
a) &&
b) %
c) @
d) &
Q:
Which of the following multiple word variable names does not conform to the good programming practices in the text?
a) multiple_word_variable_name
b) multipleWordVariableName
c) multiplewordvariablename
d) aReallyReallyLongMultipleWordVa
Q:
Which of the following statements is false?
a) C is case sensitive.
b) Uppercase and lowercase letters are different in C.
c) identifier and IdEnTiFiEr are identical identifiers in C.
d) Identifiers can be of any length
Q:
Which of these is not a valid identifier?
a) a_valid_identifier
b) a1_valid_identifier
c) a_valid_identifier_
d) 1_valid_identifier
Q:
Which statement is false.
a) Variables may be defined anywhere in the body of main.
b) All variables must be defined before they are used.
c) All variable definitions must include the name and data type of each variable.
d) Several variables of the same data type may be defined in one definition.
Q:
A(n) __________ is a location in the computer's memory where a value can be stored for use by a program.
a) unknown
b) name
c) variable
d) declaration
Q:
The __________ sign is also known as the __________ operator.
(a) +, assignment
(b) =, assignment
(c) *, stream manipulator
(d) &, stream insertion
Q:
Which statement prints "hi" on the screen?
(a) puts("hi");
(b) put "hi";
(c) puts "hi";
(d) none of the above
Q:
Which of the following is an invalid identifier (variable name)?
(a) _Test
(b) TEST
(c) 5test
(d) test1
Q:
Which of the following is not a valid integer value?
(a) -3
(b) 0
(c) 2134859
(d) 1.1
Q:
Q:
A linked program is often called a(n) __________.
a) chain
b) library
c) object
d) executable
Q:
Q:
The following line is most properly an example of a __________.
puts( "Welcome to C!" );
a) function
b) block
c) statement
d) header
Q:
Which of the following is not a synonym for a C string?
a) message
b) character string
c) character
d) literal
Q:
The pair of braces that delineate the body of main and the portion of the program between these braces is called a __________.
a) function
b) block
c) statement
d) header
Q:
In the line
int main()
the parentheses indicate that main is a program building block called a
a) module
b) statement
c) directive
d) function
Q:
Which of the following statements about the inclusion of <stdio.h> is false?
a) It is required.
b) This header file contains information and declarations used by the compiler when compiling standard input/output library functions such as printf.
c) This header file contains information that helps the compiler determine if calls to library functions have been made correctly.
d) This header helps locate bugs in your program at compile time, rather than at execution time (when errors are usually more costly to correct).
Q:
Lines beginning with a # are processed
a) at execution time.
b) at compile time.
c) at preprocessor time.
d) at postprocessor time.
Q:
Which statement about comments is false?
a) Comments begin and end with /* and */, respectively.
b) Programmers insert comments to document programs and improve program readability.
c) Comments do not cause any machine language object code to be generated.
d) Lengthy comments can cause poor execution-time performance.
Q:
Q:
Every statement in C must end with a
(a) period (.)
(b) semicolon (;)
(c) colon (:)
(d) backslash (/)
Q:
Which of the following must every C program have?
(a) main
(b) #include
(c) /*
(d) <stdio.h>
Q:
Which software product release category is "generally feature complete and supposedly bug free, and ready for use by the community?"
(a) Alpha.
(b) Beta.
(c) Release candidate.
(d) Continuous beta.
Q:
________ involves reworking programs to make them clearer and easier to maintain while preserving their correctness and functionality.
(a) Object-oriented programming
(b) Refactoring
(c) Agile software development
(d) LAMP
Q:
The World Wide Web ________.
(a) was developed at roughly the same time as the Internet
(b) paved the way for the Internet
(c) was developed years after the Internet
(d) was designed for "stand-alone" computers
Q:
What is bandwidth?
(a) information carrying capacity
(b) response time
(c) the set of networking protocols
(d) an error-control technique
Q:
An ancestor of today's Internet was _____________.
(a) ARPAnet
(b) e-mail
(c) PHP
(d) TCP/IP