Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
117 lines (87 loc) · 2.96 KB
/
Copy pathmain.cpp
File metadata and controls
117 lines (87 loc) · 2.96 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include <iostream>
#include <string>
int addNumbers(int first_number, int second_number)
{
int sum = first_number + second_number;
return sum;
}
int main()
{
// int first_number;
// int second_number;
// int sum;
/* first_number = 19;
second_number = 11;
std::cout << "First Number: " << first_number << std::endl;
std::cout << "Second Number: " << second_number << std::endl;
sum = first_number + second_number;
std::cout << "Sum = " << sum << std::endl;
sum = addNumbers(1, 200);
std::cout << "Sum = " << sum << std::endl;
sum = addNumbers(22.4, 99);
std::cout << "New Sum Value = " << sum << std::endl;
*/
// int user_age;
// std::string user_name;
/*
std::cout << "What is your name: " << std::endl;
std::getline(std::cin, user_name);
std::cout << "How old are you: " << std::endl;
std::cin >> user_age;
std::cout << "Welcome " << user_name << ", you are " << user_age << " years old" << std::endl;
std::clog << "Log Message: Something is wrong" << std::endl;
std::cerr << "Error Alert! Check All Systems!!" << std::endl;
*/
// int number1;
// int number2;
// int number3;
// int number4;
/*
number1 = 15;
number2 = 017;
number3 = 0x0f;
number4 = 0b00001111;
std::cout << "Number: " << number1 << std::endl;
std::cout << "Number: " << number2 << std::endl;
std::cout << "Number: " << number3 << std::endl;
std::cout << "Number: " << number4 << std::endl;
*/
/*
int number; // without braces
std::cout << number << std::endl; // assigns random number to integer
int body_count{}; // with braces
std::cout << body_count << std::endl; // initialises at 0, unless declared
int my_count{11};
std::cout << my_count << std::endl; // initialises at 11
int his_count{19};
std::cout << his_count << std::endl; // initialises at 19
int our_counts{my_count + his_count};
std::cout << our_counts << std::endl; // declares sum total 30
///int num_error_check(2.9); // cuts of .9
///std::cout << num_error_check << std::endl;
//int num_error_check{2.9}; // gives Warning! not int, double/float data type
//std::cout << num_error_check << std::endl;
int num_error_check(2 + 5); // outputs 7
std::cout << num_error_check << std::endl;
*/
// Size Op
/*
int best_one = 3.4;
int next_best = 9.6;
std::cout << "Size Of int: " << sizeof(int) << std::endl;
std::cout << "Size of Best one: " << sizeof(best_one) << std::endl;
*/
// Integr Modifier
/*
int value{11};
int another_value{-221}; //works
signed int value{11};
signed int another_value{-221}; //works normally
unsigned int value{11};
unsigned int another_value{-221}; //won't work | compile error
std::cout << value << std::endl;
std::cout << another_value << std::endl;
*/
//Floats and Doubles
return 0;
}