blob: a90c622b84fb4d4139b385011e8b6cf165ae29fe (
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
74
|
// Name: Connor McDowell
// Date: 1/20/24
// Class: CST116
// Assignment: homework 1
#include <iostream>
using std::cout;
using std::cin;
int main()
{
int i = 12;
int j = 5;
int q = 14;
const int k = 1024;
int first = 0;
int second = 0;
int third = 0;
int sum = 0;
int product = 0;
int diff_one = 0;
int diff_two = 0;
int end = 0;
cout << "Please input your first number" << std::endl;
std::cin >> first;
cout << "Please input your second number" << std::endl;
std::cin >> second;
cout << "Please input your last number" << std::endl;
std::cin >> third;
sum = first + second + third;
product = first * second * third;
diff_one = sum - k;
diff_two = product - k;
cout << "The sum of " << first << " and " << second << " and " << third << " is " << sum << "\n";
cout << "The product of " << first << " and " << second << " and " << third << " is " << product << "\n";
cout << "The difference between the sum total, " << sum << " and " << k << " is " << diff_one << "\n";
cout << "The difference between the product, " << product << " and " << k << " is " << diff_two << "\n";
enum color_list { red, blue, green };
union MyUnion;
{
int intValue = 2;
double floatValue = 2.3;
char charValue = 2;
};
struct myStruct;
{
union MyUnion;
enum color_list;
};
typedef struct myStruct my_struct;
/* cout << "enter a number and hit enter to end";
std::cin >> end;
/* std::cout << "Hello World"<< std::endl;
cout << "Enter a whole number: ";
std::cin >> i;
cout << "Your number was: " << i << std::endl;
*/
return 0;
}
|