package main
import (
"fmt"
"strconv"
)
func main() {
// Example 1: Convert int to float64
intValue := 42
floatValue := float64(intValue)
fmt.Printf("int to float64: %v -> %v\n", intValue, floatValue)
// Example 2: Convert float64 to int
anotherFloatValue := 3.14
anotherIntValue := int(anotherFloatValue)
fmt.Printf("float64 to int: %v -> %v\n", anotherFloatValue, anotherIntValue)
// Example 3: Convert int to string
numericValue := 123
stringValue := strconv.Itoa(numericValue)
fmt.Printf("int to string: %v -> %v\n", numericValue, stringValue)
// Example 4: Convert string to int
numericString := "456"
convertedNumericString, _ := strconv.Atoi(numericString)
fmt.Printf("string to int: %v -> %v\n", numericString, convertedNumericString)
}