Created
October 30, 2018 09:45
-
-
Save HemantNegi/344ecccb54d4eda3cc2a2b827f2e34a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Enter your code here. Read input from STDIN. Print output to STDOUT | |
// | |
//What is the execution order in the following program, and also the output ? | |
package main | |
import "fmt" | |
var WhatIsThe = AnswerToLife() | |
func AnswerToLife() int { | |
fmt.Println("asdfasdfasdf") | |
return 42 | |
} | |
func init() { | |
WhatIsThe = 0 | |
} | |
func main() { | |
if WhatIsThe == 0 { | |
fmt.Println("It's all a lie.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment