Lesson 4 C++ Operators Flashcards

1
Q

An _______ is a symbol that tells the
compiler to perform specific mathematical or
logical manipulations.

A

operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the symbol for Assignment Operator

A

=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

used for assignment, it takes the right-hand side (called rvalue) and copy it into the left-hand side (called lvalue).

A

’ = ‘

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

___________________________ modify the current value of a variable by performing an operation on it. Example. (+=, -=, *=, /=, %=,&raquo_space;=, «=, &=, ^=, |=)

A

Compound assignment operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

There are operators used to perform basic
mathematical operations. Addition (+) , subtraction (-) , division (/) multiplication (*) and modulus (%) are the basic mathematical
operators.

A

Mathematical / Arithmetic Operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

increases the value of a variable by 1.

A

increment operator or ++

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

decreases the value of a variable by 1.

A

decrement operator or –

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Two expressions can be compared using
relational and equality operators.

Ex. (==, !=, > , < , >=, <= )

A

Relational and Comparison Operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Identify the operator for these description:
1.) Equal to
2.) Not equal to
3.) less than
4.) greater than
5.) less than equal to
6.) greater than or equal to

A

1.) ==
2.) !=
3.) <
4.) >
5.) <=
6.) >=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the Logical Operators

A

(!, && , ||)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the C++ operator for the
Boolean operation NOT.

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

This operator corresponds to the Boolean
logical operation AND

which yields true if both its operands are true, and false otherwise.

A

&&

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

This operator corresponds to the
Boolean logical operation OR

which yields true if either of its operands is true, thus being false only when both operands are false.

A

||

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

used to separate two or more expressions that are included where only one expression is expected. When the set of expressions has to be evaluated for a value, only the right- most
expression is considered.

A

comma operator (,)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

evaluates an expression, returning one value if that expression evaluates to true, and a different one if the expression evaluates as false.

Symbol is “ ? “

A

Conditional Ternary Operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

modify variables considering the bit patterns that represent the values they store.

A

Bitwise operators

16
Q

Example of Bitwise operators

A

( &, |, ^, ~, «,&raquo_space; )

17
Q

_____ is a compile-time operator used to
calculate the size of data type or variable.

A

sizeof