
C++ Operators w\ Variables
Presentation
•
Computers
•
9th - 12th Grade
•
Medium
Michael Ask
Used 5+ times
FREE Resource
4 Slides • 8 Questions
1
C++ Operators w\ Variables
by Michael Ask
2
Multiple Choice
Which of these characters is used for multiplication?
+
-
*
/
x
3
Operating on Variables
The most important operations will be done on variables, in C++. Frequently you will want to add two variables together, or subtract something from one of them, or multiply two together.
It might look something like this...
int x = 3;
int y = 4;
cout << x + y;
4
Multiple Choice
What is the output of this code?
int c = 4;
int d = 2;
cout << c*d;
6
2
8
16
5
Lots of variables
Maybe you have a need for more than one variable. It happens! Maybe like this...
int l = 4;
int w = 2;
int h = 3;
cout << "The volume is " << l*w*h;
What is the purpose of this code?
6
Multiple Choice
What does this code output?
int g = 2;
int h = 2;
int j = 3;
cout << (g + j) * h;
10
8
12
6
7
Multiple Choice
What does this code output?
int r = 2;
int s = 3;
int t = 5;
cout << r + s * t;
11
17
25
10
8
Changing variables
Look at this code...
int x = 3;
What if we want to change it to a 6? We can do this...
x = 6;
OR
x = x * 2;
9
Multiple Choice
What is the output of this code?
int x = 5;
x = 3;
cout << x;
3
5
15
2
10
Multiple Choice
What is the output of this code?
int x = 3;
x = x + 2;
cout << x;
5
2
3
1
11
Multiple Choice
What is the output of this code?
int x = 4;
int y = 2;
y = x * y;
cout << y;
8
16
2
4
12
Multiple Choice
What is the output of this code?
int x = 2;
int y = 6;
y = y / 2;
x = x + y;
cout << x;
5
6
2
3
C++ Operators w\ Variables
by Michael Ask
Show answer
Auto Play
Slide 1 / 12
SLIDE
Similar Resources on Wayground
8 questions
HTML Tables
Presentation
•
9th - 12th Grade
11 questions
INTERNET 101: WIRES, CABLES & WIFI
Presentation
•
9th - 12th Grade
8 questions
Membuat Halaman Login Hotspot Mikrotik
Presentation
•
9th - 12th Grade
8 questions
Website Lesson & Rating Activity
Presentation
•
9th - 12th Grade
11 questions
Teenager 5 Session 22: Pronunciation & Speaking
Presentation
•
KG
10 questions
บทเรียนวิชาคอมพิวเตอร์พื้นฐาน
Presentation
•
KG
10 questions
Clase 2 - Cierre
Presentation
•
9th - 12th Grade
9 questions
Logarithms
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