File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Data_Structures_and_Algorithms_in_cpp
22
3- hello :)
3+ hello :)
4+
5+ https://code.visualstudio.com/docs/cpp/config-linux#_debug-helloworldcpp
Original file line number Diff line number Diff line change 1+ #include < cstdlib>
2+ #include < iostream>
3+ #include < string>
4+ using std::string;
5+ using std::cout;
6+
7+ void characters () {
8+ std::cout << " 'A' = " << int (' A' ) << std::endl;
9+ std::cout << " '\\ 0' = " << int (' \0 ' ) << std::endl;
10+ }
11+
12+ void sizes () {
13+ std::cout << " size of int " << sizeof (int ) << std::endl;
14+ std::cout << " size of long " << sizeof (long ) << std::endl;
15+ std::cout << " size of char " << sizeof (char ) << std::endl;
16+
17+ }
18+
19+ void usingStrings () {
20+ string s = " to be" ;
21+ string t = " not" + s;
22+ string u = s + " or " + t;
23+ if (s > t) {
24+ cout << u << std::endl;
25+ }
26+
27+ }
28+
29+ /* This program inputs two numbers x and y and outputs their sum */
30+ int main () {
31+ int x, y;
32+ std::cout << " Please enter two numbers: " ;
33+ std::cin >> x >> y; // input x and y
34+ int sum = x + y; // compute their sum
35+ std::cout << " Their sum is " << sum << std::endl;
36+
37+ characters ();
38+ sizes ();
39+ usingStrings ();
40+
41+ return EXIT_SUCCESS; // terminate successfully
42+ }
You can’t perform that action at this time.
0 commit comments