Value assignment

Report a typo

Suppose you have a pointer ptr of type int, and num that is a random integer read from the stdin.

Assign the value of num to the integer variable that ptr points to, and then output the value pointed to by ptr.

Sample Input 1:

10

Sample Output 1:

10
Write a program in Go
package main

import "fmt"

func main() {
var ptr = new(int)
var num int
fmt.Scan(&num)

// Write your code below:
? = ?

fmt.Println(?)
}
___

Create a free account to access the full topic