// Defining the constant values for error #define ERROR "Error"
//Check the error if number contains alphabetic characters #define ERROR1 "ERROR Number 1"
//Check the ERROR for unknown operation #define EROR2 "ERROR Number 2"
//ERROR for division by Zero #define EROR3 "ERROR Number 3"
//ERROR if operation not possible #define EROR4 "ERROR Number 4"
//ERROR if input strings are longer than limit #define EROR5 "ERROR Number 5"
//Defining prototypes for functions int DATA_RECALL(int *num_1, int *num_2, char *operation); void CALCULATE(int num1, int num2, char operator_); int VALID_CHECK_1 (char input[11], int *output); int VALID_CHECK_2(char input[11], int *output, char*valid_operator); int ERROR_CHECK (int retval); int OPERATOR_VERIFICATION(char optor_in, char *optor_out);
void main () { printf("Please enter the values for required calculation :\n"); char string[5]; int num_1 = 0, num_2 = 0; while(strcmp(string,"QUIT")) { flushall(); char operation = ' '; if (!ERROR_CHECK( DATA_RECALL(&num_1, &num_2, &operation))) CALCULATE (num_1, num_2, operation); printf("\n-----------------------------\n"); printf("Type 'QUIT' to exit.\n"); printf("Press any key to continue\n"); printf("And press Enter key: "); scanf("%s",string); printf("-----------------------------\n"); printf("\nPlease enter the values for required calculation :\n"); puts("");
} }
int DATA_RECALL(int *num_1, int *num_2, char *operation) { int value= 0; int counter = 0; char buffer[48], overflow[24]="", tmpNum2[12]="\0", tmp_operator = ' ', tmpNum1[12]= "\0";