VOOZH
about
URL: https://www.geeksforgeeks.org/go-language/golang-program-that-uses-func-with-two-arguments/
⇱ Golang program that uses func with two arguments - GeeksforGeeks
👁 geeksforgeeks
Courses
Tutorials
Interview Prep
Go Tutorial
Data Types
Keywords
Decision Making
Functions
Structures
Arrays
Strings
Pointers
Interface
Concurrency
Golang program that uses func with two arguments
Last Updated :
12 Jul, 2025
Functions
may use certain parameters to receive values and perform the task required accordingly. The syntax for a function with two arguments is:
func function_name( [parameter_1 parameter_2] ) [return_types] { body of the function }
Example 1:
Without any return type
Output:
30
Example 2:
With return type
Output:
30
Comment
Article Tags:
Article Tags:
Go Language
Go-Functions
Explore
Basics
Introduction to Go Language
2 min read
How to Install Go on Windows?
3 min read
How to Install Golang on MacOS?
2 min read
Hello World in Golang
2 min read
Fundamentals
Identifiers in Go Language
2 min read
Go Keywords
2 min read
Data Types in Go
7 min read
Go Variables
5 min read
Constants- Go Language
6 min read
Go Operators
9 min read
Control Statements
Go Decision Making (if, if-else, Nested-if, if-else-if)
5 min read
Loops in Go Language
6 min read
Switch Statement in Go
2 min read
Functions & Methods
Functions in Go Language
3 min read
Variadic Functions in Go
3 min read
Anonymous function in Go Language
2 min read
main and init function in Golang
2 min read
What is Blank Identifier(underscore) in Golang?
3 min read
Defer Keyword in Golang
3 min read
Methods in Golang
3 min read
Structure
Structures in Golang
7 min read
Nested Structure in Golang
3 min read
Anonymous Structure and Field in Golang
3 min read
Arrays
Arrays in Go
7 min read
How to Copy an Array into Another Array in Golang?
3 min read
How to pass an Array to a Function in Golang?
2 min read
Slices
Slices in Golang
14 min read
Slice Composite Literal in Go
3 min read
How to sort a slice of ints in Golang?
2 min read
How to trim a slice of bytes in Golang?
3 min read
How to split a slice of bytes in Golang?
3 min read
Strings
Strings in Golang
6 min read
How to Trim a String in Golang?
2 min read
How to Split a String in Golang?
3 min read
Different ways to compare Strings in Golang
2 min read
Pointers
Pointers in Golang
8 min read
Passing Pointers to a Function in Go
3 min read
Pointer to a Struct in Golang
3 min read
Go Pointer to Pointer (Double Pointer)
4 min read
Comparing Pointers in Golang
3 min read
Concurrency
Goroutines - Concurrency in Golang
2 min read
Select Statement in Go Language
4 min read
Multiple Goroutines
2 min read
Channel in Golang
7 min read
Unidirectional Channel in Golang
2 min read
Courses
Data Structures and Algorithms Course
2 min read
DSA and System Design Course
2 min read
Java Backend Development Course
2 min read