wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C++ Operator

Total questions: 30

Worksheet time: 20mins

Name
Class
Date
1.
The process of creating a new variable without value
a)
declaration
b)
naming
c)
instantiation
d)
assigning
2.

What does <= mean?

a)

less than

b)

greater than

c)

less than or equal to

d)

greater than or equal to

3.

What is the only function all C++ programs must contain?

a)

start()

b)

system()

c)

main()

d)

program()

4.

What punctuation is used to signal the beginning and end of code blocks?

a)

{ }

b)

-> and <-

c)

BEGIN and END

d)

( and )

5.

Which of the following is a correct comment?

a)

*/ Comments */

b)

** Comment **

c)

/* Comment */

d)

{ Comment }

6.
The process of creating a new variable without value
a)
declaration
b)
naming
c)
instantiation
d)
assigning
7.

What does <= mean?

a)

less than

b)

greater than

c)

less than or equal to

d)

greater than or equal to

8.
A list of instructions that enable a computer to perform a specific task is a...
a)
Computer Program
b)
Algorithm
c)
Machine Code
d)
Binary Code
9.
Which command moves the shown text to the next line?
a)
\t
b)
\n
c)
\r
d)
\s
10.
After running the following code, what will be the value of x?
y = 3;
x = 5 * y;
a)
3
b)
5
c)
15
d)
0
11.
A programmer is:
a)
person who writes code and communicates instructions to a computer
b)
person who types
c)
person who studies computers
d)
error or mistake in your code
12.

What is the output of this program?
#include <iostream>

using namespace std;

int main()
{
cout<<"Hi everybody";
return 0;
}

a)
"Hi everybody"
b)
Hi everybody"
c)
Hi everybody
d)
"Hi everybody
13.
... variables store whole numbers (-4, 3, 51, etc). 
a)
Float
b)
Logical
c)
Character
d)
Integer
14.
... point variables store decimal numbers (3.5, -5,123, 4.0, etc). 
a)
Float
b)
Integer
c)
Logical
d)
Character
15.

Which of the following is NOT a logical operator in C++ language?

a)

&

b)

&&

c)

||

d)

!

16.

Which of the following is NOT a comparison operator in C++ language?

a)

>

b)

<=

c)

=

d)

==

17.

c++ is an _____________ , developed by ______________ , and is an extension of c language

a)

object oriented program , Bjarane

b)

class and data

c)

complier, interpreter

d)

functions comments

18.

computers work on instructions given to them in a specific language which is known as __________

a)

programming language

b)

bitcode

19.

a program written in a high language is called a ____________

a)

object

b)

source code

c)

variable

d)

constant

20.

_____ is an object oriented language

a)

c++

b)

compiler

c)

programming

21.

_________ in programming come into use when we need to repeatedly execute a block of statements.

a)

nested for loop

b)

none

c)

for loop

d)

loop

22.

Two expressions can be compared using ___________ operator.

a)

Logical

b)

Relational

c)

Arithmetic

23.

______ is used to input value from the user.

a)

cin>>

b)

cin<<

c)

<cin>

24.

Which is one is relational operators?

a)

<, >, <=, >=, ==, !=

b)

+, -, *, /, %

c)

=, +=, -=, *=, /=, %=

d)

&&, ||, !

25.

Which is one is assignment operators?

a)

&&, ||, !

b)

+, -, *, /, %

c)

<, >, <=, >=, ==, !=

d)

=, +=, -=, *=, /=, %=

26.

What is the difference between double and float?

a)

The byte size

b)

Same, no difference

c)

Decimals

27.

Which library is used for input output in C++?

a)

<stdio>

b)

<stdlib>

c)

<iostream>

d)

<math>

28.

What is the output of this code?

int x = 8;

// x = 3;

cout<<x<<endl;

a)

3

b)

8

c)

error

d)

x

29.

What is the type of the temp variable?

var temp = 14.55;

a)

Double

b)

Boolean

c)

Integer

d)

String

30.

iostream is used for?

a)

Displays output from the screen and input from the keyboard

b)

Has all the math equations

c)

Counts the time

d)

Checks if the code has a function