Skip to content

Commit

Permalink
add: golang code to change coffee to code (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcsandesh authored Oct 27, 2023
1 parent 93ce2fd commit b894ac7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions golang/SandeshGC.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"fmt"
"strings"
)

func main() {
var word string

fmt.Println("What is the secret word?")
fmt.Scanf("%s", &word)

if (word != "Coffee") && (word != "coffee") {
fmt.Println("Secret word invalid! Try again.")
} else {
fmt.Println(strings.Split(word, "")[0] + "ode")
}
}

0 comments on commit b894ac7

Please sign in to comment.