Skip to content

Instantly share code, notes, and snippets.

@ihsanarifr
Created April 15, 2021 06:21
Show Gist options
  • Save ihsanarifr/8a9807c853a49b2da930ab4e37c21eb2 to your computer and use it in GitHub Desktop.
Save ihsanarifr/8a9807c853a49b2da930ab4e37c21eb2 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func main() {
str := "santekno"
count := 0
for _, ch := range str {
switch ch {
case 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U':
count++
}
}
fmt.Printf("kalimat %s mengandung vokal sebanyak: %d\n", str, count)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment