Skip to content

Instantly share code, notes, and snippets.

@rchaganti
Created August 11, 2020 11:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rchaganti/33b2cbf4fc121999d38c6ead7911eecd to your computer and use it in GitHub Desktop.
Save rchaganti/33b2cbf4fc121999d38c6ead7911eecd to your computer and use it in GitHub Desktop.
D3 Swap Variables
Create a program that declares two integer variables i and j and assigns values 10 and 30.
Print the values of these variables. Add an expression to swap the values of the variables using assignment operator.
Finally, print the values of the variable values after swapping.
@sureshkrishnan83
Copy link

package main

import (
"fmt"
)

func main() {

var fname string = "suresh krishnan"
fmt.Println("Hello", fname)

var i, j = 10, 30
fmt.Println("value of i and j", i, j)
i, j = j, i
fmt.Println("value of i and j", i, j)

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment