add: if statement exercises
This commit is contained in:
36
11-if/exercises/07-leap-year/main.go
Normal file
36
11-if/exercises/07-leap-year/main.go
Normal file
@@ -0,0 +1,36 @@
|
||||
// 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
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE: Leap Year
|
||||
//
|
||||
// Find out whether a given year is a leap year or not.
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// go run main.go
|
||||
// Give me a year number
|
||||
//
|
||||
// go run main.go eighties
|
||||
// "eighties" is not a valid year.
|
||||
//
|
||||
// go run main.go 2018
|
||||
// 2018 is not a leap year.
|
||||
//
|
||||
// go run main.go 2019
|
||||
// 2019 is not a leap year.
|
||||
//
|
||||
// go run main.go 2020
|
||||
// 2020 is a leap year.
|
||||
//
|
||||
// go run main.go 2024
|
||||
// 2024 is a leap year.
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
}
|
Reference in New Issue
Block a user