aboutsummaryrefslogtreecommitdiff
path: root/Homework 1/Homework__1.cpp
blob: 5caf8917b1c364b2035189558ea6fa04acd03b7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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: " << my_product << 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;
}