Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a Go program to implement a simple calculator using functions for addition, subtraction, multiplication, and division.

Easy

Problem Statement

Write a Go program to implement a simple calculator using functions for addition, subtraction, multiplication, and division.

Sample Input

Two integers and an operation (e.g., 5, 10, "+").

Sample Output

15

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
package main import "fmt" func add(a, b int) int { return 0 } func main() { // Call the function for the desired operation }
Log in or sign up to run or submit your code.Log inSign up
Input
Two integers and an operation (e.g., 5, 10, "+").
Expected Output
15