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
| #include <iostream> int main() { using namespace std; // nSelection must be declared outside do/while loop int nSelection; do { cout << "Please make a selection: " << endl; cout << "1) Addition" << endl; cout << "2) Subtraction" << endl; cout << "3) Multiplication" << endl; cout << "4) Division" << endl; cin >> nSelection; } while (nSelection != 1 && nSelection != 2 && nSelection != 3 && nSelection != 4); // do something with nSelection here // such as a switch statement return 0; } |
- Intro + +
- Basics + +
- Compiling your first program
- Structure of a program
- Comments
- A first look at variables (and cin)
- A few common C++ problems
- A first look at operators
- A first look at functions
- Whitespace and basic formatting
- Forward declarations
- Header files
- Programs with multiple files
- A first look at the preprocessor
- Variables + +
- IDE + +
- Operators + +
- Variable + +
- Control Flow + +
- Array + +
- Functions + +
- OOPS + +
- Overloading + +
- Composition + +
- Inheritance + +
- Programs + +
0 comments: