Go Fundamentals Value Types

GoGoBeginner
Practice Now

This tutorial is from open-source community. Access the source code

Introduction

This challenge aims to test your understanding of Golang's basic value types, including strings, integers, floats, and booleans.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL go(("`Go`")) -.-> go/BasicsGroup(["`Basics`"]) go/BasicsGroup -.-> go/values("`Values`") subgraph Lab Skills go/values -.-> lab-15446{{"`Go Fundamentals Value Types`"}} end

Value Types

Your task is to complete the calculate function that takes in two integers and returns their sum and product.

Requirements

  • The calculate function should take in two integers as parameters.
  • The calculate function should return two integers, the sum and product of the input parameters.

Example

$ go run values.go
golang
1+1 = 2
7.0/3.0 = 2.3333333333333335
false
true
false

Summary

In this challenge, you were tasked with completing the calculate function to calculate the sum and product of two integers. By doing so, you were able to demonstrate your understanding of Golang's basic value types.

Other Go Tutorials you may like