WorksheetsCPP-3
Total questions: 20
Worksheet time: 30mins
iostream
Displays output from the screen and input from the keyboard
Has all the math equations
Counts the time
Checks if the code has a function
cmath
Simple math
Stands for complicated math
Add, subtract, divide, multiply
Timming
What punctuation is used to signal the beginning and end of code blocks?
{ }
-> and <-
BEGIN and END
( and )
Which of the following is NOT a comparison operator in C++ language?
>
<=
=
==
Evaluate the following expressions to true or false
5 >= (1+6)-4
True
False
Evaluate the following expressions to true or false
5+1==6 || 8-1>4
True
False
Assume the following code:
int x=5, y=10;
if (x>y){ cout << "ok";}
else {cout << "not ok";}
What is the output?
ok
not ok
x>y
no output at all
What is the output?
not ok
ok
ok
not ok
What is the output?
Congrats, you got an A+
check in With ME.
You got an A-
Check in with me.
What would be the output of the following code:
Spell it out
Comp Prog
Abbreviate both words!
Why would you abbreviate only one of the words?
What is output here:
Big Number
It's a small big number
Big Number
It's a small big number.
What kind of number?
What is the output:
What is wrong with this program?
Nothing.
Everything.
What is the maximum number of else-if statements
As Many as You Need
One
Two
Zero
If originally x=2,y=0, and z=1, what is the value of x, y, and z after executing the following code?
if (x>y)
y=x;
else
z=x;
x=2 y=2 z=1
x=0 y=2 z=0
x=2 y=1 z=1
x=2 y=0 z=1
an AND operation with the mask 10101010 is applied to the binary number 01010101.
show the result.
01010101
1111
00000000
11110000
What is the output when the following code fragment is executed?
danger
count = 5
count=5
danger
count=4
count = 4
What is the output when the following code fragment is executed?
Error
n = 3.8
3
n = 3
