Skip to content

Commit

Permalink
Update in code
Browse files Browse the repository at this point in the history
Added a multiplication operation and case extra
  • Loading branch information
anushree71199 authored Oct 9, 2020
1 parent a22fe89 commit 7008e4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Calci/Calculator.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
int main() {
char operator;
double first, second;
printf("Enter an operator (+, -): ");
printf("Enter an operator (+, -,*): ");
scanf("%c", &operator);
printf("Enter two operands: ");
scanf("%lf %lf", &first, &second);
Expand All @@ -16,6 +16,9 @@ int main() {
break;
case '*':
printf("%.1lf * %.1lf = %.1lf", first, second, first * second);
break;
case '*':
printf("%.1lf * %.1lf = %.1lf", first, second, first * second);
break;
// operator doesn't match any case constant
default:
Expand Down

0 comments on commit 7008e4e

Please sign in to comment.