diff options
Diffstat (limited to 'Homework 1/Homework__1.cpp')
| -rw-r--r-- | Homework 1/Homework__1.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Homework 1/Homework__1.cpp b/Homework 1/Homework__1.cpp index e69de29..cf710eb 100644 --- a/Homework 1/Homework__1.cpp +++ b/Homework 1/Homework__1.cpp @@ -0,0 +1,73 @@ +// Name: Nataliia Brown +// Date: 1/14/24 +// Class: CST 116 +// Assignment: Homework 1 + + +#include <iostream> + +using namespace std; +using std::cout; +using std::cin; +using std::endl; + +int main() +{ + int a; + + int b; + + int c; + + const int K = 1024; + + cout << "Input first integer: " << endl; + + cin >> a; + + cout << "Input second integer: " << endl; + + cin >> b; + + cout << "Input third integer: " << endl; + + cin >> c; + + + int my_sum = a + b + c; + int my_product = a * b* c; + + cout << "The sum of all three variables is: " << my_sum << " and the multiplied value of all three variables is: " << a * b * c << endl; + + cout << "The difference between the sum and const is: " << my_sum - K << endl; + cout << "The difference between the mult and const is: " << my_product - K << endl; + + enum myItems { + item1, + item2, + item3 + }; + + union myUnion { + int number_1; + int number_2; + int number_3; + }; + + struct myStruct { + enum myOtherItems { other1, other2, other3 }; + union myOtherUnion { + int other_1; + int other_2; + int other_3; + }; + }; + + typedef struct newStruct { + int x; + int y; + int z; + }st_xyz; + + return 0; +}
\ No newline at end of file |