C Plus Plus - From 101 To 222 Multiple Choice

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Mrmirante
M
Mrmirante
Community Contributor
Quizzes Created: 2 | Total Attempts: 4,310
| Attempts: 658
SettingsSettings
Please wait...
  • 1/122 Questions

    122. When a program instructs the computer to assign a value to a memory location, if the value’s data type does not match the memory location’s data type, the computer uses a process called ____ to convert the value to fit the memory location.

    • Implicit type conversion
    • Explicit type conversion
    • Casting d. translating
Please wait...
About This Quiz

Are you an aspiring programmer and have just started learning C++ language? The quiz below is perfect for you and is from 101 to 222 and is a multiple-choice quiz to help you understand it better. All the best and keep an eye out for some more C++ quizzes. All the best.

C Plus Plus - From 101 To 222 Multiple Choice - Quiz

Quiz Preview

  • 2. 

    177. The ____ store the information passed to the function when the function is invoked.

    • Actual parameters

    • Formal parameters

    • Actual arguments

    • Formal arguments

    Correct Answer
    A. Formal parameters
    Explanation
    Formal parameters are variables defined in the function declaration and are used to store the information passed to the function when it is invoked. They act as placeholders for the actual values that will be passed as arguments. In this case, the correct answer is "formal parameters" because they are the variables that store the information passed to the function.

    Rate this question:

  • 3. 

    130. In a flowchart, there is/are ____ flowline(s) leading out of the selection/repetition symbol.

    • One

    • Two

    • Three

    • Four

    Correct Answer
    A. Two
    Explanation
    In a flowchart, there are two flowlines leading out of the selection/repetition symbol. This symbol is used to represent a decision point where the flow of the program can branch out into two different paths based on a condition. The two flowlines represent the two possible outcomes or paths that the program can take after the decision is made.

    Rate this question:

  • 4. 

    102. The repetition structure is also referred to as a loop or as ____.

    • Branch

    • Iteration

    • Select

    • Repeat

    Correct Answer
    A. Iteration
    Explanation
    The repetition structure is also referred to as a loop or as iteration. This is because in programming, a repetition structure allows a certain set of instructions to be repeated multiple times until a specific condition is met. The term "iteration" is commonly used to describe this process of repeating a set of instructions. Therefore, "iteration" is the correct answer as it is another commonly used term to refer to the repetition structure or loop in programming.

    Rate this question:

  • 5. 

    141. A(n) ____ is a set of step-by-step instructions that accomplish a task.Consider the following pseudocode:1. enter the code and sales amount2. calculate the bonus amount by multiplying the sales amount by .083. if (the code is X)if (the sales are greater than or equal to 10000)add 150 to the bonus amountelseadd 125 to the bonus amountend ifend if4. display the bonus amount

    • Algorithm

    • Pseudocode

    • Flowchart

    • IPO

    Correct Answer
    A. Algorithm
    Explanation
    The given pseudocode represents a set of step-by-step instructions that accomplish a task. It outlines the process of entering the code and sales amount, calculating the bonus amount based on the sales amount, and displaying the bonus amount. Therefore, the correct answer is algorithm.

    Rate this question:

  • 6. 

    175. The modulus arithmetic operator (____) divides two integers and results in the remainder of the division.

    • &

    • ^

    • %

    • #

    Correct Answer
    A. %
    Explanation
    The modulus arithmetic operator (%) divides two integers and gives the remainder of the division. For example, if we divide 10 by 3 using the modulus operator (%), the result is 1, because 10 divided by 3 equals 3 with a remainder of 1. Therefore, the correct answer is %.

    Rate this question:

  • 7. 

    222. When two or more methods have the same name but different parameterLists, the methods are referred to as ____ methods.

    • Overloaded

    • Twin

    • Encapsulated

    • Default

    Correct Answer
    A. Overloaded
    Explanation
    When two or more methods have the same name but different parameter lists, they are referred to as overloaded methods. Overloading allows multiple methods to have the same name but different parameters, allowing for more flexibility and versatility in programming. This allows developers to create methods that perform similar tasks but with different inputs, improving code readability and organization.

    Rate this question:

  • 8. 

    114. ____ refers to the process of locating and removing any errors in a program.

    • Debugging

    • Testing

    • Linking

    • Compiling

    Correct Answer
    A. Debugging
    Explanation
    Debugging refers to the process of locating and removing any errors in a program. It involves identifying and fixing the bugs or issues that may cause the program to not function correctly. This process is essential in ensuring the program's functionality and reliability. Testing, linking, and compiling are all important steps in the software development process, but they do not specifically focus on locating and removing errors in a program like debugging does.

    Rate this question:

  • 9. 

    145. The flowchart symbol for the switch form of the selection structure is the ____.

    • Oval

    • Rectangle

    • Diamond

    • Parallelogram

    Correct Answer
    A. Diamond
    Explanation
    The flowchart symbol for the switch form of the selection structure is the diamond. In a flowchart, the diamond shape represents a decision point where different paths can be taken based on the value of a specific variable or condition. The switch form of the selection structure allows for multiple conditions to be evaluated and different actions to be taken based on each condition. Therefore, the diamond symbol is used to indicate this decision-making process in the flowchart.

    Rate this question:

  • 10. 

    176. To use the time() function in a program, the program must contain the ____ directive.

    Explanation
    To use the time() function in a program, the program must contain the "time.h" directive. This directive includes the necessary header file that contains the declaration of the time() function. The time() function is used to retrieve the current calendar time in seconds since the Unix epoch. By including the "time.h" directive, the program can access and utilize the time() function for time-related operations.

    Rate this question:

  • 11. 

    110. In a flowchart, the oval symbol is called the ____ symbol.

    • Input/output

    • Process

    • Selection

    • Start/stop

    Correct Answer
    A. Start/stop
    Explanation
    The oval symbol in a flowchart is called the start/stop symbol. This symbol represents the beginning or end of the flowchart and indicates where the process starts or stops. It is commonly used to show the initiation or termination of a program or process.

    Rate this question:

  • 12. 

    133. You use ____ to test for equality in C++.

    • =

    • ==

    • :=

    • !=

    Correct Answer
    A. ==
    Explanation
    In C++, the == operator is used to test for equality. This operator compares two values and returns true if they are equal, and false otherwise. It is commonly used in conditional statements and loops to check if two values are equal. The = operator, on the other hand, is used for assignment, not equality testing. The := and != operators are not valid operators in C++.

    Rate this question:

  • 13. 

    135. The And operator in C++ is ____.

    • &

    • !

    • &&

    • ||

    Correct Answer
    A. &&
    Explanation
    The correct answer is &&. In C++, the && operator is the logical AND operator. It is used to combine two conditions and returns true only if both conditions are true.

    Rate this question:

  • 14. 

    113. ____ is called the extraction operator.

    • ->

    • >>

    Correct Answer
    A. >>
    Explanation
    The extraction operator ">>" is used in C++ to extract data from an input stream, such as reading values from the console or a file. It is called the extraction operator because it extracts the data from the stream and stores it in a variable.

    Rate this question:

  • 15. 

    148. In C++, the switch statement begins with the switch clause followed by an opening ____.

    • [

    • {

    • "

    Correct Answer
    A. {
    Explanation
    In C++, the switch statement begins with the switch clause followed by an opening curly brace. The opening curly brace is used to indicate the start of the block of code that will be executed based on the value of the expression in the switch clause.

    Rate this question:

  • 16. 

    123. After executing the following lines of code, the result will be ____.int average = 0;double test1 = 90.0;double test2 = 81.0;average = (test1 + test2) / 2;

    • 85 assigned to average

    • 85.5 assigned to average

    • 6 assigned to average

    • A syntax error

    Correct Answer
    A. 85 assigned to average
    Explanation
    The given code calculates the average of test1 and test2 by summing them and dividing by 2. Since test1 is 90.0 and test2 is 81.0, the sum is 171.0. Dividing 171.0 by 2 gives us 85.0. However, the variable average is an integer type, so it can only store whole numbers. Therefore, the decimal part of 85.0 is truncated, and the final value assigned to average is 85.

    Rate this question:

  • 17. 

    129. The ____ in a flowchart is called the selection/repetition symbol.

    • Rectangle

    • Diamond

    • Parallelogram

    • Circle

    Correct Answer
    A. Diamond
    Explanation
    The diamond symbol in a flowchart is used to represent the selection/repetition structure. This structure is used to make decisions or repeat a set of instructions based on certain conditions. The diamond symbol typically contains a question or a condition that determines the flow of the program. Therefore, the correct answer is diamond.

    Rate this question:

  • 18. 

    134. When the ____ logical operator is used to create a compound condition, all of the conditions must be true for the compound condition to be true.

    • And

    • Or

    • Not

    • Xor

    Correct Answer
    A. And
    Explanation
    When the "And" logical operator is used to create a compound condition, it requires all of the conditions to be true in order for the compound condition to be true. This means that if any of the conditions within the compound condition are false, the entire compound condition will be false.

    Rate this question:

  • 19. 

    168. In the code shown above, the ____ variable is used as a counter.

    • Sales

    • Region

    • TotRegSales

    • Cout

    Correct Answer
    A. Region
    Explanation
    In the given code, the "region" variable is used as a counter. It is likely that the code is counting the number of sales or transactions that occur within a specific region. The other variables mentioned, such as "sales", "totRegSales", and "cout", do not necessarily indicate that they are being used as counters in this context.

    Rate this question:

  • 20. 

    190. When the computer processes the return 0; statement in the main() function, it returns the number 0 to the ____ to indicate that the program ended normally.

    • Command-line

    • Operating system

    • Calling function

    • Calling program

    Correct Answer
    A. Operating system
    Explanation
    When the computer processes the return 0; statement in the main() function, it returns the number 0 to the operating system to indicate that the program ended normally. The operating system uses the return value to determine the status of the program execution. A return value of 0 typically signifies successful execution, while non-zero values may indicate errors or abnormal termination.

    Rate this question:

  • 21. 

    136. The Or operator in C++ is ____.

    Explanation
    The Or operator in C++ is used to combine two conditions and returns true if either one of the conditions is true. It is represented by the symbol "||" and is commonly used in conditional statements and loops to create complex logical expressions.

    Rate this question:

  • 22. 

    104. The Windows environment typically uses ____ such as check boxes, list boxes, and buttons.

    • Registers

    • Objects

    • Procedures

    • Mnemonics

    Correct Answer
    A. Objects
    Explanation
    In the Windows environment, various graphical elements such as check boxes, list boxes, and buttons are commonly used. These elements are referred to as objects because they are distinct entities that can be interacted with by the user. Unlike registers, which are low-level storage locations in the computer's hardware, or procedures, which are sequences of instructions, objects in the Windows environment provide a visual interface for users to interact with the system. Mnemonics, on the other hand, are memory aids or shortcuts used to remember information, and are not directly related to the graphical elements in the Windows environment.

    Rate this question:

  • 23. 

    132. You can use ____ to override the order of precedence of comparison operators.

    • {}

    • []

    • ()

    Correct Answer
    A. ()
    Explanation
    Parentheses () can be used to override the order of precedence of comparison operators. By using parentheses, we can group certain comparisons together and ensure that they are evaluated before others. This allows us to control the order in which the comparisons are performed and can be useful when we want to prioritize certain comparisons over others.

    Rate this question:

  • 24. 

    143. A common error made when writing selection structures is to use a ____ operator in the outer selection structure’s condition when a nested selection structure is needed.

    • Logical

    • Comparison

    • Mathematical

    • Concatenation

    Correct Answer
    A. Logical
    Explanation
    When writing selection structures, it is important to use the correct operator in the condition. In this case, the correct operator to use is the logical operator. Using a logical operator allows for the evaluation of multiple conditions and the execution of different code blocks based on the result. Using a comparison, mathematical, or concatenation operator would not allow for the same level of control and flexibility in the selection structure.

    Rate this question:

  • 25. 

    167. In the code shown above, the ____ clause begins the outer loop.

    • Int totRegSales = 0;

    • While (region < 3)

    • Cin >> sales;

    • While (sales > 0)

    Correct Answer
    A. While (region < 3)
    Explanation
    The correct answer is "while (region < 3)" because this clause is the starting point of the outer loop. It sets the condition for the loop to continue running as long as the value of the variable "region" is less than 3.

    Rate this question:

  • 26. 

    181. The scope of a variable can be either ____.

    • Local or global

    • Small or large

    • Real or virtual

    • Internal or external

    Correct Answer
    A. Local or global
    Explanation
    The scope of a variable refers to the part of a program where the variable is accessible. A local variable is one that is declared within a specific block of code, such as a function, and can only be accessed within that block. On the other hand, a global variable is one that is declared outside of any specific block and can be accessed from anywhere in the program. Therefore, the scope of a variable can be either local or global, depending on where it is declared.

    Rate this question:

  • 27. 

    111. In a flowchart, the parallelogram symbol is called the ____ symbol.

    Explanation
    In a flowchart, the parallelogram symbol is called the "input/output" symbol. This symbol represents any input or output operation in the flowchart, such as reading data from a user or displaying information to the user. It is used to indicate the points in the flowchart where data is either entered into the system or displayed to the user.

    Rate this question:

  • 28. 

    165. The do while statement ends with a(n) ____.

    • .

    • ,

    • ;

    • //end do while comment

    Correct Answer
    A. ;
    Explanation
    The do while statement ends with a semicolon (;). This is because the semicolon is used to terminate a statement in many programming languages, including C++. In the context of a do while loop, the semicolon indicates the end of the loop body and is placed immediately after the closing brace (}) of the loop block.

    Rate this question:

  • 29. 

    154. In a flowchart, the repetition symbol contains the loop ____.

    • Condition

    • Body

    • Iterator

    • Sentinel

    Correct Answer
    A. Condition
    Explanation
    The repetition symbol in a flowchart represents a loop, and the correct answer for the loop component that it contains is the "condition". This means that the loop will continue to repeat as long as the specified condition is true. The condition acts as a control mechanism for the loop, determining when it should stop executing and when it should continue.

    Rate this question:

  • 30. 

    201. The information in a(n) ____ access file is always accessed in consecutive order from the beginning of the filethrough the end of the file.

    • Sequential

    • Random

    • Binary

    • I/O

    Correct Answer
    A. Sequential
    Explanation
    A sequential access file is a type of file where the data is stored and accessed in a sequential order, starting from the beginning of the file and moving towards the end. This means that the data can only be accessed in the order it was written into the file. Unlike random access files where data can be accessed in any order, sequential access files are read or written sequentially, making them suitable for tasks that require reading or writing data in a linear manner. Therefore, the correct answer is sequential.

    Rate this question:

  • 31. 

    206. When using the open() function, you use the ____ mode to open a file for input.

    • Ios::input

    • Ios::in

    • Ios::io

    • Ios::app

    Correct Answer
    A. Ios::in
    Explanation
    When using the open() function, you use the ios::in mode to open a file for input. This mode allows the program to read data from the file.

    Rate this question:

  • 32. 

    120. ____ is a character literal constant.

    • X

    • "x"

    • ‘x’

    • $x

    Correct Answer
    A. ‘x’
    Explanation
    A character literal constant is a single character enclosed within single quotation marks. In this case, the correct answer is ‘x’ because it is the only option that follows this format. The other options, X, "x", and $x, do not meet the criteria of being enclosed within single quotation marks.

    Rate this question:

  • 33. 

    157. ____ means to assign a beginning value to a counter or accumulator variable.

    • Initializing

    • Iterating

    • Flushing

    • Accumulating

    Correct Answer
    A. Initializing
    Explanation
    Initializing means to assign a beginning value to a counter or accumulator variable. It is the process of setting the initial state or value of a variable before it is used in a program. By initializing a variable, we ensure that it starts with a known value, which can be important in calculations or loops where the variable's value is updated or incremented. This helps in maintaining the accuracy and reliability of the program's logic and results.

    Rate this question:

  • 34. 

    160. The repetition structure is referred to more simply as a(n) ____.

    • Loop

    • Iteration

    • Case

    • Switch

    Correct Answer
    A. Loop
    Explanation
    The correct answer is "loop" because a repetition structure is a programming construct that allows a set of instructions to be executed repeatedly until a certain condition is met. This term is commonly referred to as a "loop" because it creates a cycle of executing the same set of instructions multiple times.

    Rate this question:

  • 35. 

    171. A(n) ____ is a block of code that performs a task.

    • Statement

    • Expression

    • Function

    • Program

    Correct Answer
    A. Function
    Explanation
    A function is a block of code that performs a specific task. It is a reusable piece of code that can be called or invoked multiple times throughout a program. Functions help in organizing code and improving code reusability. They can accept input parameters, perform operations, and return a value if required. In this context, a function is the most appropriate option as it accurately describes a block of code that performs a task.

    Rate this question:

  • 36. 

    112. ____ is called the insertion operator.

    • ->

    • >>

    Correct Answer
    A.
    Explanation
    The insertion operator in programming is denoted by the double greater than symbol (>>). It is used to insert data into an output stream, such as displaying values on the console or writing to a file. This operator is commonly used in C++ to concatenate or display multiple variables or values in a single output statement.

    Rate this question:

  • 37. 

    121. ____ is a string literal constant.

    • X

    • ""

    • ‘Hello’

    • $Hello

    Correct Answer
    A. ""
    Explanation
    The empty string "" is a string literal constant. It represents a string that contains no characters.

    Rate this question:

  • 38. 

    152. Values that are used to end loops are referred to as ____ values.

    • Iterator

    • Sentinel

    • Break

    • Accumulator

    Correct Answer
    A. Sentinel
    Explanation
    Sentinel values are used to indicate the end of a loop. They are typically predefined values that are used to terminate the loop when encountered. In this context, the sentinel value is used to signal the loop to stop iterating and exit. The other options listed, such as iterator, break, and accumulator, do not specifically refer to values used to end loops.

    Rate this question:

  • 39. 

    146. In a flowchart, the switch symbol has ____ flowline(s) leading out of the symbol.

    • Zero

    • One

    • Two

    • Many

    Correct Answer
    A. Many
    Explanation
    The switch symbol in a flowchart can have multiple flowlines leading out of it, allowing for multiple possible paths or conditions in the flowchart. This allows for more complex decision-making and branching in the flowchart, making it a versatile symbol in representing different possibilities and outcomes.

    Rate this question:

  • 40. 

    166. You can stop an endless loop either by pressing ____ or by clicking the Close button on the Command Prompt window.int sales = 0;int region = 1;int totRegSales = 0;while (region < 3){cout << "First sales amount for Region "<< region << ": ";cin >> sales;while (sales > 0){totRegSales = totRegSales + sales;cout << "Next sales amount for Region "<< region << ": ";cin >> sales;} //end whilecout << endl << "Region " << region << " sales: $"<< totRegSales << endl << endl;region = region + 1;totRegSales = 0;} //end whilecout << "End of program" << endl;

    • Ctrl+x

    • Ctrl+c c

    • Ctrl+x d

    • Ctrl+q

    Correct Answer
    A. Ctrl+c c
    Explanation
    You can stop an endless loop either by pressing Ctrl+c c or by clicking the Close button on the Command Prompt window.

    Rate this question:

  • 41. 

    188. The function prototype ____ indicates that the first two variables are passed by value, while the third and fourth variables are passed by reference.

    • Void calc(double, double, double &, double &);

    • Void calc(double %, double %,double, double);

    • Void calc(double, double, double @, double @);

    • Void calc(double *, double *, double, double);

    Correct Answer
    A. Void calc(double, double, double &, double &);
    Explanation
    The correct answer is "void calc(double, double, double &, double &);" because the "&" symbol before the last two variables indicates that they are passed by reference. Passing by reference allows the function to modify the values of the variables directly, rather than creating a copy of the variables. The absence of any other symbols or modifiers in the function prototype indicates that the first two variables are passed by value, meaning their values are copied into the function.

    Rate this question:

  • 42. 

    192. ____ declares and initializes a four-element string array named states; each element is initialized to the empty string.

    • String states[4] = {""};

    • Tring [4]states = {""};

    • String states[4] = {};

    • String states[] = {""};

    Correct Answer
    A. String states[4] = {""};
    Explanation
    The correct answer is "string states[4] = {""};" because it declares and initializes a four-element string array named states, where each element is initialized to the empty string.

    Rate this question:

  • 43. 

    200. The information in a(n) ____ access file can be accessed by its byte location in the file.

    • Sequential

    • Random

    • Binary

    • I/O

    Correct Answer
    A. Binary
    Explanation
    A binary access file allows for direct access to specific bytes within the file. Unlike sequential access, which requires reading through the file sequentially from the beginning, or random access, which requires an index or key to access specific records, binary access allows for direct retrieval of data based on its byte location. This makes it efficient for accessing and manipulating data at specific positions within the file.

    Rate this question:

  • 44. 

    208. The ____ statement tells the computer to open for append the employ.txt file located on the A drive.

    • OutEmploy.open(ios::app, "a:\employ.txt");

    • OutEmploy.open("a:\employ.txt",ios::app);

    • OutEmploy.open(ios::app, "a:\", "employ.txt");

    • OutEmploy.open("a:\", "employ.txt", ios::app);

    Correct Answer
    A. OutEmploy.open("a:\employ.txt",ios::app);
    Explanation
    The correct answer is outEmploy.open("a:\employ.txt",ios::app); because it uses the correct syntax to open the employ.txt file located on the A drive for append. The "a:\" specifies the drive and the "employ.txt" specifies the file name. The ios::app flag is used to open the file in append mode, which means that any data written to the file will be added to the end of the existing content.

    Rate this question:

  • 45. 

    142. If the code is X and the sales amount is 15000, the value of the bonus amount at the end of the algorithm will be ____.

  • 46. 

    184. The function body in a ____ function does not contain a return expression; statement.

    • Program-defined

    • Built-in

    • Value-returning

    • Void

    Correct Answer
    A. Void
    Explanation
    A void function is a program-defined function that does not contain a return expression or statement. This means that when the function is called, it performs certain actions or operations but does not return any value back to the caller. Void functions are commonly used when there is no need to return a result or when the desired outcome is achieved through side effects, such as modifying global variables or printing output.

    Rate this question:

  • 47. 

    207. The scope resolution operator in C++ is ____.

    • .

    • ->

    • ::

    • @

    Correct Answer
    A. ::
    Explanation
    The scope resolution operator in C++ is "::". This operator is used to access members of a class or namespace that are defined outside of the class or namespace. It allows the programmer to specify the exact scope from which they want to access the member.

    Rate this question:

  • 48. 

    147. In C++, you use the ____ statement to code the switch form of the selection structure.

    • If

    • If/else

    • Case

    • Switch

    Correct Answer
    A. Switch
    Explanation
    In C++, the switch statement is used to code the switch form of the selection structure. The switch statement allows you to compare the value of a variable against multiple cases and execute different blocks of code based on the matched case. It provides a more efficient way to handle multiple conditions compared to using multiple if/else statements. Therefore, the correct answer is "switch".

    Rate this question:

  • 49. 

    191. A subscript is also called a(n) ____.

    • Iterator

    • Scalar

    • Key

    • Index

    Correct Answer
    A. Index
    Explanation
    A subscript is also called an index because it is used to access specific elements in a data structure, such as an array or a list. The index represents the position or location of an element within the data structure, allowing for easy retrieval and manipulation of the desired element.

    Rate this question:

Quiz Review Timeline (Updated): Aug 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Aug 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 22, 2009
    Quiz Created by
    Mrmirante
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.