2018-10-13 23:30:21 +03:00
|
|
|
// For more tutorials: https://blog.learngoprogramming.com
|
|
|
|
//
|
|
|
|
// Copyright © 2018 Inanc Gumus
|
|
|
|
// Learn Go Programming Course
|
|
|
|
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
|
|
|
//
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
// ---------------------------------------------------------
|
2018-10-27 17:39:25 +03:00
|
|
|
// EXERCISE: Iota Months
|
|
|
|
//
|
2018-10-13 23:30:21 +03:00
|
|
|
// 1. Initialize the constants using iota.
|
|
|
|
// 2. You should find the correct formula for iota.
|
|
|
|
//
|
|
|
|
// RESTRICTIONS
|
|
|
|
// 1. Remove the initializer values from all constants.
|
|
|
|
// 2. Then use iota once for initializing one of the
|
|
|
|
// constants.
|
|
|
|
//
|
|
|
|
// EXPECTED OUTPUT
|
|
|
|
// 9 10 11
|
|
|
|
// ---------------------------------------------------------
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
const (
|
|
|
|
Nov = 11
|
|
|
|
Oct = 10
|
|
|
|
Sep = 9
|
|
|
|
)
|
|
|
|
|
|
|
|
fmt.Println(Sep, Oct, Nov)
|
|
|
|
}
|