Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
using namespace std; int main() { int choice; float fnum,snum; cout << "==== SIMPLE CALCULATOR ====" << endl; cout << "\nEnter First Number: "; cin >> fnum; cout << "Enter Second Number: "; cin >> snum; cout << "\n\nWhat operation would like to use?" << endl; cout << "\nMenu:" << endl; cout << "\t1. Addition" << endl; cout << "\t2. Subtraction" << endl; cout << "\t3. Multiplication" << endl; cout << "\t4. Division" << endl; cout << "Choose(1-4): "; cin >> choice; cout << "\n" << endl; if(choice == 1){ cout << "The Addition of " << fnum <<" and "<< snum << " is : "; cout << fnum + snum << endl; } else if (choice == 2){ cout << "The Subtraction of " << fnum <<" and "<< snum << " is : "; cout << fnum - snum << endl; } else if (choice == 3){ cout << "The Multiplication of " << fnum <<" and "<< snum << " is : "; cout << fnum * snum << endl; } else if (choice == 4){ if (fnum == 0 or snum == 0){ cout << "Can't divide to \"0\"." << endl; } else { cout << "The Division of " << fnum <<" and "<< snum << " is : "; cout << fnum / snum << endl; } } else{ cout << "Wrong choice... Please try again." << endl; } cout << "\n\n=== Credits to: Regidor, Shokri Iam ===" << endl; return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)