Write a Go program to implement a simple calculator using interfaces for different operations.
MediumProblem Statement
Write a Go program to implement a simple calculator using interfaces for different operations.
Sample Input
Two integers (e.g., 10, 5) and operations (+, -, *, /).
Sample Output
15 5 50 2
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
package main
import "fmt"
type Operation interface {
Compute(a, b int) int
}
func main() {
// Implement different operations using the interface
}
Input
Two integers (e.g., 10, 5) and operations (+, -, *, /).
Expected Output
15 5 50 2