@ -7,7 +7,6 @@
void programmingMode() {
int num1, num2, result;
char operator;
@ -20,4 +19,30 @@ void programmingMode() {
printf("Enter second integer: ");
scanf("%d", &num2);
// Calculation
switch (operator) {
case '+':
result = num1 + num2;
break;
case '-':
result = num1 - num2;
case '*':
result = num1 * num2;
case '/':
if (num2 != 0) {
result = num1 / num2;
} else {
printf("Error: Division by zero\n");
result = 0;
}
default:
printf("Invalid operator\n");
// Display the result
printf("Result: %d\n", result);