
C++ Operators
Presentation
•
Computers
•
9th - 12th Grade
•
Medium
Michael Ask
Used 12+ times
FREE Resource
6 Slides • 4 Questions
1
C++ Operators
by Michael Ask
2
Operators
Operators allow you to perform mathematical operations in C++. Like this...
3 + 3;
x / 2;
(x + y) / 2;
Notice the use of addition and division.
3
Multiple Select
What other operations do you guess C++ allows?
Multiplication
Exponents
Subtraction
4
Operators
Mathematical operations aren't ALWAYS used in code. Just most of the time. So it's important to understand how they work. In this code, the computer will make three variables. The third is the sum of the first two.
int x = 3;
int y = 4;
int z = x + y;
5
Operators and Output
While C++ performs any operation that you ask it to, it will only print it for you to see if you request it. This code...
3 + 3;
... will work, but it will give you an error telling you that you didn't use the expression. IF you wish to see the result, you must output it. Like this...
cout << 3+3;
6
Multiple Choice
Mark wants to know what 40 - 32 is, so he types it in like this...
cout << 40 + 32;
Will it work?
No
Yes
7
Multiple Choice
To print the sum of 45 and 76, what should you type?
cout << 45 + 76;
cout >> 45 + 76;
45 + 76;
45 - 76;
8
Limitations
Operators can only work in certain situations. For instance, you CANNOT add a number to a string. What would that even mean?
"Mr Ask" + 97;
This will throw an error because they are an incompatible pair of data. But C++ is even more picky. This code also does not work.
"Mr " + "Ask"
9
Multiple Choice
What would be the output of this code?
cout << 10 / 2;
5
8
20
10
Kinds of Operators
C++ Operators
by Michael Ask
Show answer
Auto Play
Slide 1 / 10
SLIDE
Similar Resources on Wayground
10 questions
Decision Making
Presentation
•
9th - 12th Grade
9 questions
Second Week
Presentation
•
9th - 12th Grade
12 questions
AP Computer Science Principles Procedures
Presentation
•
9th - 12th Grade
6 questions
Peer Evaluation and Constructive Feedback for Websites
Presentation
•
9th - 12th Grade
7 questions
Last Lesson Finale: The AI Guess Who? Game!
Presentation
•
9th - 12th Grade
6 questions
OBJECT ORIENTED PROGRAMMING LANGUAGE CONCEPTS
Presentation
•
9th - 12th Grade
8 questions
Quizizz Information Session
Presentation
•
9th - 12th Grade
8 questions
Q341_Elektronik
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
20 questions
"What is the question asking??" Grades 3-5
Quiz
•
1st - 5th Grade
20 questions
“What is the question asking??” Grades 6-8
Quiz
•
6th - 8th Grade
10 questions
Fire Safety Quiz
Quiz
•
12th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
34 questions
STAAR Review 6th - 8th grade Reading Part 1
Quiz
•
6th - 8th Grade
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
47 questions
8th Grade Reading STAAR Ultimate Review!
Quiz
•
8th Grade
Discover more resources for Computers
10 questions
Fire Safety Quiz
Quiz
•
12th Grade
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
10 questions
Fire Prevention
Quiz
•
9th - 12th Grade
24 questions
BIOLOGY STAAR REVIEW
Quiz
•
9th Grade
50 questions
STAAR English 2 Review
Quiz
•
10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
30 questions
English 1 STAAR Review
Quiz
•
9th Grade