Search Header Logo
C++ Operators

C++ Operators

Assessment

Presentation

Computers

University

Practice Problem

Hard

Created by

Kittisay SENGTHONG

Used 4+ times

FREE Resource

7 Slides • 6 Questions

1

C++ Operators

ຕົວດຳເນີນການ

Slide image

2

C++ Operators

Operators are used to perform operations on variables and values.

In the example below, we use the operator to add together two values:

Slide image

3

Fill in the Blank

ໃຫ້ສ້າງຕົວປ່ຽນເພື່ອລວມ ຄ່າທັງສອງເຂົ້ານຳກັນ ເຊິ່ງຄ່າທີ່ 1 ແມ່ນ 20 ແລະ ຄ່າທີ່ 2 ແມ່ນ 10 ໂດຍຊື່ຕົວປ່ຽນຂອງເຮົາແມ່ນ y

4

C++ Operators

Although the + operator is often used to add together two values, like in the example above, it can also be used to add together a variable and a value, or a variable and another variable:

Slide image

5

Arithmetic Operators

  • +

  • -

  • *

  • /

  • %

  • ++

  • --

Slide image

6

Fill in the Blank

ຈົ່ງຂຽນ operator ທີ່ມັກມາ 1 ອັນ

7

C++ Assignment Operators

  • =

  • +=

  • -=

  • *=

  • /=

  • %=

  • &=

Slide image

8

Multiple Choice

ຂໍ້ໃດຕໍ່ໄປນີ້ ບໍ່ແມ່ນ Assignment Operators

1

+=

2

*=

3

/

4

-=

9

Comparison Operators

Comparison operators are used to compare two values.

Note: The return value of a comparison is either true (1) or false (0).

In the following example, we use the greater than operator (>) to find out if 5 is greater than 3:

Slide image

10

Fill in the Blank

ຈົ່ງຂຽນ Comparison Operators ເພື່ອປຽບທຽບ ຄ່າຂອງຕົວປ່ຽນຕໍ່ໄປນີ້

int a=10, b=20;

11

C++ Logical Operators

  • &&

  • ||

  • !

Slide image

12

Fill in the Blank

ຈົ່ງຂຽນ Logical Operators ທີ່ຕົວເອງມັກມາ 1 ຕົວ

13

Poll

ໃຫ້ຄະແນນກັບຫົວຂໍ້ Operators

ງ່າຍ

ທຳມະດາ

ຍາກ

ຍາກຫຼາຍ

C++ Operators

ຕົວດຳເນີນການ

Slide image

Show answer

Auto Play

Slide 1 / 13

SLIDE