Computers and Technology
how do I fix when it hits the second session it skips scanf. #include #include #include main() { double first, second;while(1){printf(" Calculator\n");printf("\n 7 8 9 / \n 4 5 6 x \n 1 2 3 - \nEnter operator: ");char op;scanf("%c" ,&op); //entering operators such as + - \ *printf("Enter two operands:");scanf("%lf %lf", &first, &second); //entering operands such as 1 2 5 8 12 414 switch (op) { // printing the math case '+'://if its + printf("%.1lf + %.1lf = %lf\n\n", first, second, first + second); break; case '-'://if its - printf("%.1lf - %.1lf = %lf\n\n", first, second, first - second); break; case '*'://if its * printf("%.1lf * %.1lf = %lf\n\n", first, second, first * second); break; case '/'://if its : printf("%.1lf / %.1lf = %lf\n\n", first, second, first / second); break; default://if its not + - / * printf("error!");}}}