diff options
| author | Nataliia Brown <[email protected]> | 2024-01-16 22:54:34 -0800 |
|---|---|---|
| committer | Nataliia Brown <[email protected]> | 2024-01-16 22:54:34 -0800 |
| commit | b0ce288b7faf57d0ee7f945d138535da38c18c3a (patch) | |
| tree | f2aa5ede8f9e5fe595beb347f0629756d7fcf4a9 | |
| parent | Initial commit Homework 1 (diff) | |
| download | hello-world-natabrown-b0ce288b7faf57d0ee7f945d138535da38c18c3a.tar.xz hello-world-natabrown-b0ce288b7faf57d0ee7f945d138535da38c18c3a.zip | |
Adding Homework 1 to Hello World project
| -rw-r--r-- | Hello World/Hello World/Homework_1.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Hello World/Hello World/Homework_1.cpp b/Hello World/Hello World/Homework_1.cpp index e69de29..7433005 100644 --- a/Hello World/Hello World/Homework_1.cpp +++ b/Hello World/Hello World/Homework_1.cpp @@ -0,0 +1,69 @@ +// 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; + + cout << "The sum of all three variables is: " << a + b + c << " and the multiplied value of all three variables is: " << a * b * c << endl; + + cout << "The difference between the sum and const is: " << a + b + c - K << endl; + cout << "The difference between the mult and const is: " << a * b * c - 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 |