diff --git a/src/main/c/programmingMode.c b/src/main/c/programmingMode.c index 6a63556..e4c2b8d 100644 --- a/src/main/c/programmingMode.c +++ b/src/main/c/programmingMode.c @@ -44,16 +44,12 @@ int performOperation(int num1, char operator, int num2) { } void programmingMode() { - int num1, num2, result; - char operator; - num1 = getIntegerInput("Enter first integer: "); - operator = getOperatorInput(); - num2 = getIntegerInput("Enter second integer: "); + int num1 = getIntegerInput("Enter first integer: "); + char operator = getOperatorInput(); + int num2 = getIntegerInput("Enter second integer: "); // Calculation + Display the result - result = performOperation(num1, operator, num2); - - printf("Result: %d\n", result); + printf("Result: %d\n", performOperation(num1, operator, num2)); } \ No newline at end of file