# Functions

```rust
visibility fun function_name(arg1:data_type,arg2:data_type ,..) : (data_type,data_type,..)
{
    //your code
}
```

Below code helps us understand that how we can pass on arguments and return values from functions.

```rust
module my_addrx::Functions
{
    use std::debug::print;
    use std::string::utf8;

    fun greet()
    {
        print(&utf8(b"Functions in move"));
    }


    fun sqaure(num : u64)
    {
        let s=num*num;
        print(&s);
    }
    
    //function returning maximum of two numbers
    fun max(num1 : u64,num2 : u64): u64{
        if(num1 < num2)
            return num2
        else    
            return num1
    }


    //In move a function can return multiple values
    fun is_even(num : u64) : (u64,bool)
    {
        if(num % 2 == 0)
            return (num,true)
        else
            return (num,false)
    }


    #[test]
    fun testing()
    {
        greet();
        sqaure(10);

        let m=max(53,10);
        print(&m);

        let (v1,v2) = is_even(4);
        print(&v1);
        print(&v2);

    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://move-developers-dao.gitbook.io/aptos-move-by-example/basic-concepts/functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
