WorksheetsRecap C++
Total questions: 20
Worksheet time: 10mins
What is the characteristics of C++ programming?
- Modular
- Portable
- Supports procedural and OOP
- Case-Sensitive
- Rich Library
- Modular
- Portable
- Rich Library
- Supports procedural and OOP
- Case-Sensitive
- Rich Library
- Rich Library
None
Which is one is relational operators?
<, >, <=, >=, ==, !=
+, -, *, /, %
=, +=, -=, *=, /=, %=
&&, ||, !
Which is one is assignment operators?
&&, ||, !
+, -, *, /, %
<, >, <=, >=, ==, !=
=, +=, -=, *=, /=, %=
Which are logical operators?
&&
||
!
All of the answers
(3 * 8 – 2 * 5) % (2 - 1) == ?
1
0
14
10
What is the difference between double and float?
The byte size
Same, no difference
Decimals
Which are variable initialization?
A
B
C
None
What header needed when using character testing?
#include <cctype>
#include <iomanip>
#include <cstring>
#include <string>
Which is the output for the program?
Which one is the program output?
4.9188
4.92
4.919
4.91877
Which are the syntax for C-string with white spaces?
getline(cin, variableName);
cin.getline(arrayName, arraySize);
cin >> variableName;
Which program to appends / combines a string to a string?
strcat
strstr
strcmp
strlen
Which function used to get the program output?
strncpy (string1, string2);
strcpy (string1, string2);
strncat (string1, string2);
strcmp (string1, string2);
Which one is repetition control structure?
How many types of selection control structure?
5
4
3
1
Which one is the syntax of if statement?
if (statement)
expression;
if (expression);
if
statement;
if (expression)
statement;
Which one is the syntax of if...else statement?
if (expression)
statement;
else
statement;
if (statement)
statement;
else
expression;
if (expression)
statement;
if (expression)
statement;
else if (expression)
statement;
Which looping statement has 3 counter-controlled elements?
1. Initialization
2. Boolean expression
3. Update
For loop and do...while loop.
For loop and while loop.
For loop only.
While loop and do...while loop.
Which of the following is the answer for the output program?
None of the answers
Does the program output can be executed if there is no break statement in each switch cases?
Can
Cannot
