The first one is that I'm trying to use a while function to terminate the program when the word "none" is typed for the operation.
The second one is that I keep getting the "floating point exception (core dumped)" error every time that I set that "The denominator cannot be 0 while performing a division operation." for the dividing function.
#include <iostream>
usingnamespace std;
int main(){ //main function
char operation;
int num1;
int num2;
cout << "Enter operator either + or - or * or /: ";
cin >> operation;
cout << "Enter the first integer: ";
cin >> num1;
cout << "Enter the second integer: ";
cin >> num2;
while ((integer = cin.get()))
switch(operation) {
case'+':
cout << num1+num2;
break;
case'-':
cout << num1-num2;
break;
case'*':
cout << num1*num2;
break;
case'/':
cout << num1/num2;
if (num2 < 1){
cout << "The denominator cannot be 0 while performing a division operation." << endl;
}
break;
default:
/* If operator is other than +, -, * or /, error message is shown */
cout << "The operation is invalid.";
break;
}
return 0;