From 04266e78eea26a7bb72a47958f7bf989e93e58bf Mon Sep 17 00:00:00 2001 From: Bapi Gupta Date: Sat, 15 Aug 2020 02:36:56 +0530 Subject: [PATCH 1/2] sridha added line --- main.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index e34bfa8..6f3535e 100644 --- a/main.go +++ b/main.go @@ -1,13 +1,11 @@ package main - // import formatted I/O package import ( "algos/src/Algo/other/permutaions" "fmt" ) - // We define a function add which takes 2 int variables as function parameters // Returns addition of the parameters with type int func add(a int, b int) int { @@ -19,10 +17,9 @@ func compareA(a float64, b float64) bool { return a > b } - // Any program in go start with main function inside "main' package // You can put main inside any other folders like src/main/main.go -func main() { +func main() { fmt.Printf("Hello World!\n") // Notice type of variable declarations @@ -31,13 +28,13 @@ func main() { // After declaring 2 is assigned a = 2 // We declare and assigned variable 'b' with value 4 - var b = 4 + var b = 4 // This is another way of defining variable where we put := for assigning data to variable in LHS // c is not declared we just assigned it with 4.2 which explicitly makes it a variable of float type with value 4.2 - c:=4.2 + c := 4.2 - d:=2.42 + d := 2.42 // C style I/o printing with %d representing placeholder for in variables specifically of type int fmt.Printf("Addition of %d and %d is = %d\n", a, b, add(a, b)) @@ -50,12 +47,12 @@ func main() { // %v is placeholder for bool fmt.Printf("Is %.2f is grater thant %.2f ? \nAnswer is %v\n", c, d, compareA(c, d)) - - // importing permutations package created under src/Algo/other fmt.Println(permutaions.FactorialRecursive(10)) stringVar := "abcd" permutationStrings := permutaions.HeapsPermutation(4, stringVar) fmt.Println(permutationStrings) + + fmt.Println("Sridha Saha") } From 7dc29ba670a18bc7dea5e78756a2e6eb584f5647 Mon Sep 17 00:00:00 2001 From: Bapi Gupta Date: Sat, 15 Aug 2020 02:42:44 +0530 Subject: [PATCH 2/2] A new feature --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index 6f3535e..4d42d51 100644 --- a/main.go +++ b/main.go @@ -55,4 +55,5 @@ func main() { fmt.Println(permutationStrings) fmt.Println("Sridha Saha") + fmt.Println("on branch sridha for adding career TV") }