Level up your skills by byte size resources
Path intended to achieve your particular goal.
Find dozens of free cheatsheets for quick reference.
Find the Archive of our bootcamps and quick tutorial videos.
Indepth Information about a certain topics.
Make a simple calculator that accepts 2 operands from the user and performs the operation, based on the knowledge you gained in the previous chapters.
Solution
# include using namespace std; int main() { char op; float num1, num2; cout << "Enter operand 1: "; cin >> num1; cout<<"enter operand 2:"; cin>>num2 cout << "Enter operator either + or - or * or /: "; cin >> op; switch(op) { case '+': cout << num1+num2; break; case '-': cout << num1-num2; break; case '*': cout << num1*num2; break; case '/': if(num1>num2) cout << num1/num2; else cout<
Output: Enter operand 1: 10 Enter operand 2: 60 6