WorksheetsC++ Mini Quiz
Total questions: 22
Worksheet time: 14mins
What does <= mean?
less than
greater than
less than or equal to
greater than or equal to
What is the only function all C++ programs must contain?
start()
system()
main()
program()
What punctuation is used to signal the beginning and end of code blocks?
{ }
-> and <-
BEGIN and END
( and )
Which of the following is a correct comment?
*/ Comments */
** Comment **
/* Comment */
{ Comment }
y = 3;
x = 5 * y;
Program
int main()
{
cout<<"Hi everybody";
return 0;
}
I have a variable int a = 2;
then a variable int& b = a;
What happens if I change the value of b
Nothing
a changes as well
b gets bigger
a disappears
True or False. This code will output 0
cout<< 23 % 2 <<endl;
True
False
True or False. This code will output 1
cout<< 55 % 2 <<endl;
True
False
Fill in the blank to get 0 outputted from this code:
int main() {
cout<< 12 ___ 12 <<endl;
}
-
+
==
%
Fill in the blank to get 0 outputted from this code:
int main() {
cout<< 12 ___ 3 <<endl;
}
-
+
==
%
Fill in the blank to get 0 outputted from this code:
int main() {
cout<< 0 ___ 3 <<endl;
}
-
/
==
+
What is the correct value to return to the operating system upon the successful completion of a program?
A. -1
B. 1
C. 0
D. Program do not return a value.
What punctuation ends most lines of C++ code?
A. .
B. ;
C. :
D. '
The escape sequence \n when output with cost, causes the cursor to position
A. Next blank space on the same line
B. Beginning of the same line on the screen
C. End of the same line on the screen
D. Beginning of the next line on the screen
Fill in the blank to get 0 outputted from this code:
int main() {
cout<< 12 ___ 3 <<endl;
}
-
+
==
%
