forked from ardanlabs/gotraining
-
Notifications
You must be signed in to change notification settings - Fork 1
/
template1.go
36 lines (25 loc) · 978 Bytes
/
template1.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// All material is licensed under the Apache License Version 2.0, January 2004
// http://www.apache.org/licenses/LICENSE-2.0
// Declare a named type called counter with a base type of int. Declare a variable
// named c of type counter set to its zero value. Display the value of c.
//
// Declare a variable named c2 of type counter set to the value of 10. Display the value
// of c2.
//
// Declare a variable named i of the base type int. Attempt to assign the value
// of i to c. Does the compiler allow the assignment?
package main
// Add imports.
// Declare the named type called counter with a base
// type of int.
func main() {
// Declare a variable named c of type counter
// set to its zero value.
// Display the value of c.
// Declare a variable named c2 of type counter
// set to the value of 10.
// Display the value of c2.
// Declare a variable named i of the base type int.
// Assign the value of i to the variable named c.
// Does it compile?
}