Filters
Question type

Study Flashcards

The data type of a variable whose value can be either true or False is


A) int
B) binary
C) bool
D) Boolean
E) T/F

Correct Answer

verifed

verified

The preprocessor reads a program before it is compiled and only executes those lines beginning with # symbol.

Correct Answer

verifed

verified

In a C++ program, two slash marks (//) indicate


A) the end of a statement
B) the beginning of a comment
C) the end of a program
D) the beginning of a block of code
E) None of these

Correct Answer

verifed

verified

Every complete C++ program must have a


A) comment
B) function named main
C) symbolic constant
D) cout statement
E) None of these

Correct Answer

verifed

verified

Which of the following lines must be included in a program that has string variables?


A) #include (string class)
B) #include namespace std;
C) #include <string>
D) string var;
E) None of these

Correct Answer

verifed

verified

You must have a _____________ for every variable you intend to use in a program.


A) purpose
B) variable definition
C) memory space
D) literal value
E) None of these

Correct Answer

verifed

verified

Which of the following statements correctly assigns the character M to the variable named letter?


A) letter = M
B) letter = "M";
C) letter = 'M';
D) letter = (M) ;
E) letter = M;

Correct Answer

verifed

verified

C++ does not have a built-in data type for storing strings of data.

Correct Answer

verifed

verified

Which part of the following line is ignored by the compiler? Double userName = "janedoe"; // user's name is janedoe


A) "janedoe"
B) user's name is
C) user's name is janedoe
D) //
E) None of these

Correct Answer

verifed

verified

When typing your source code into the computer, you should be careful since most of your C++ instructions, header files, and variable names are case sensitive.

Correct Answer

verifed

verified

A variable's __________ is the part of the program that has access to the variable.


A) data type
B) value
C) scope
D) assignment
E) None of these

Correct Answer

verifed

verified

What is the value of number after the following statements execute? Int number; Number = 18 / 4;


A) 4.5
B) 4
C) 2
D) 0
E) unknown

Correct Answer

verifed

verified

Which of the following is not a valid C++ identifier?


A) April2018
B) employee_number
C) _1user
D) 1user
E) theLittleBrownFoxWhoRanAway

Correct Answer

verifed

verified

Which control sequence is used to skip over to the next horizontal tab stop?


A) \n
B) end1
C) \t
D) \b
E) \'

Correct Answer

verifed

verified

What will the following code display? Cout << "Monday"; Cout << "Tuesday"; Cout << "Wednesday";


A) Monday
Tuesday
Wednesday
B) Monday Tuesday Wednesday
C) MondayTuesdayWednesday
D) "Monday"
"Tuesday"
"Wednesday"
E) "Monday" "Tuesday" "Wednesday"

Correct Answer

verifed

verified

The __________ is(are) used to display information on the computer's screen.


A) opening and closing braces
B) opening and closing quotation marks
C) cout object
D) backslash
E) None of these

Correct Answer

verifed

verified

In C++11, if you want an integer literal to be treated as a long long int, you can append __________ at the end of the number.


A) L
B) <L L>
C) LONG LONG
D) LL
E) <LONG>

Correct Answer

verifed

verified

For every opening brace ({) in a C++ program, there must be a


A) string literal
B) function
C) comment
D) closing brace
E) None of these

Correct Answer

verifed

verified

In C++, key words are written in all lowercase letters.

Correct Answer

verifed

verified

What will the following code display? Int number = 23; Cout << "The number is " << "number" << endl;


A) The number is 23
B) The number is23
C) The number is number
D) The number is null
E) The number is

Correct Answer

verifed

verified

Showing 21 - 40 of 62

Related Exams

Show Answer