diff options
| author | austinlujan <[email protected]> | 2024-03-07 17:09:08 -0800 |
|---|---|---|
| committer | austinlujan <[email protected]> | 2024-03-07 17:09:08 -0800 |
| commit | c8f413996d3b2048a5dc5471f1c6b4badfeabf45 (patch) | |
| tree | 4a0457f3f52beaea790c8a18eecf1a8460b8b625 /Project1/program.cpp | |
| parent | initial commit (diff) | |
| download | in-class-exercise-4-austinlujan-main.tar.xz in-class-exercise-4-austinlujan-main.zip | |
Diffstat (limited to 'Project1/program.cpp')
| -rw-r--r-- | Project1/program.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/Project1/program.cpp b/Project1/program.cpp index c4f8036..d88e0ec 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -11,6 +11,41 @@ using std::endl; int main() { - + int num = 0; + int q1 = 0; + int q2 = 0; + + cout << "enter a number: "; + + cin >> num; + + switch (num) + { + case 1: + cout << "You are a great person\n"; + break; + case 3: + cout << "You picked option: " << num << endl; + break; + case 55: + cout << "enter first number: "; + cin >> q1; + cout << "enter second number: "; + cin >> q2; + if (q2 == 0) + { + cout << "Cannot divide by zero"; + break; + } + int q3; + q3 = q1 % q2; + cout << "the remainder of " << q1 << " divided by " << q2 << " is: " << q3; + break; + + default: + cout << "Bad input! No switches to switch"; + break; + } + return (0); }
\ No newline at end of file |