Files
learngo/06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/main.go
2019-10-30 19:41:13 +03:00

45 lines
1.0 KiB
Go

// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
// ---------------------------------------------------------
// EXERCISE: Find the Rectangle's Perimeter
//
// 1. Find the perimeter of a rectangle
// Its width is 5
// Its height is 6
//
// 2. Assign the result to the `perimeter` variable
//
// 3. Print the `perimeter` variable
//
// HINT
// Formula = 2 times the width and height
//
// EXPECTED OUTPUT
// 22
//
// BONUS
// Find more formulas here and calculate them in new programs
// https://www.mathsisfun.com/area.html
// ---------------------------------------------------------
func main() {
// UNCOMMENT THE CODE BELOW:
// var (
// perimeter int
// width, height = 5, 6
// )
// USE THE VARIABLES ABOVE WHEN CALCULATING YOUR RESULT
// ADD YOUR CODE BELOW
}