From f1de37a3e7feaa72c3cdf72b18114ab41a0006c4 Mon Sep 17 00:00:00 2001 From: tbarnes98 Date: Mon, 14 Mar 2022 10:50:49 -0500 Subject: [PATCH] end of w2lec1 --- Lecture/Week2/main.cpp | 16 ++++++++++++++++ Lecture/Week2/main2.cpp | 15 +++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Lecture/Week2/main.cpp create mode 100644 Lecture/Week2/main2.cpp diff --git a/Lecture/Week2/main.cpp b/Lecture/Week2/main.cpp new file mode 100644 index 0000000..649c0b3 --- /dev/null +++ b/Lecture/Week2/main.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; + +int & multiply(int A, int B) { + int i = A*B; + return i; +} + +int main() { + int A = 5; + int B = 3; + int C = multiply(A,B); + cout << "A: " << A << " B: " << B << " C: " << C << endl; + + return 0; +} \ No newline at end of file diff --git a/Lecture/Week2/main2.cpp b/Lecture/Week2/main2.cpp new file mode 100644 index 0000000..d3085ed --- /dev/null +++ b/Lecture/Week2/main2.cpp @@ -0,0 +1,15 @@ +#include +using namespace std; + +int main() { + // int length; + // cin >> length; + int array1[3] = {3, 10, 40}; + cout << array1 << endl; + cout << *array1 << endl; + cout << array1 << endl; + + + + return 0; +} \ No newline at end of file