Skip to content

Commit

Permalink
Added filename todo.go
Browse files Browse the repository at this point in the history
  • Loading branch information
SaipraveenSPK authored Jun 20, 2022
1 parent 9a4f165 commit 496c51c
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions todo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import "fmt"

func main() {

var j int = 0
var arr [5]string

var i int = 1
for i <= 5 {

var choice int = 0
fmt.Println("1-Enter list")
fmt.Println("2-Display list")
fmt.Println("3-Exit")
fmt.Println("Enter your choice")
fmt.Scan(&choice)

if choice == 1 {
fmt.Println("Enter task:")
fmt.Scan(arr[j])
j++
continue
}
if choice == 2 {
var k int = 0
for k <= j {
fmt.Println(arr[k])
k++
}
continue
}
if choice == 3 {
break
}
i++
}

}

0 comments on commit 496c51c

Please sign in to comment.