Home > front end >  Write a function that users enter any two Numbers for any arithmetic operation (simple small counter
Write a function that users enter any two Numbers for any arithmetic operation (simple small counter

Time:09-26

.

CodePudding user response:

 
The function calc (a, p, b) {
The switch (p) {
The case "+" : the return of a + b;
Case "-" : return a - b;
A case of "*" : return a * b;
Case "/" : the return of a/b;
}
}
Alert (calc (5, "+", 3));
Alert (calc (5, "*", 3));
Alert (calc (12, "/", 3));

CodePudding user response:

Good good clear thank you
  • Related