Go Add Int And Float Number Using Go Type Casting

[Solved] Go Add Int And Float Number Using Go Type Casting | Haskell - Code Explorer | yomemimo.com
Question : Go Add int and float number using Go type casting

Answered by : samer-saeid

package main
import "fmt"
func main() { var number1 int = 20 var number2 float32 = 5.7 var sum float32 // addition of different data types sum = float32(num1) + num2 fmt.Printf("Sum is %g",sum)
}

Source : | Last Update : Thu, 23 Jun 22

Answers related to go add int and float number using go type casting

Code Explorer Popular Question For Haskell