Review

#include <iosctream>
using namespace std;

void mystery(int &a, int b){
	a *= 2;
	b *= 2;
}

int main() {
	int x = 3, y = 5;
	myster(x, y);
	cout << x << " " << y << endl;
	return 0;
}

image.png

#include <iosctream>
using namespace std;

void mix_it_up(char v1, char &v2, char v3){
	char v4 = ' ';
	
	v4 = v1;
	v1 = v2;
	v2 = v3;
	v3 = v4;
}

int main() {
	char x = 'a', y = 'b', z = 'c';
	mix_it_up(x, y, z);
	cout << x << y << z << endl;
	return 0;
	
}

image.png

Handout

#include <iostream>
using namespace std;

int main(){
    int sum = 5;
    sum += '6';
    sum -= '0'; // add this line to solve the solve
    cout << sum << endl; 
}

Predefined Functions in C++

cmath

pow(x, y)