Check out example codes for "c# function". It will help you in understanding the concepts better.

Code Example 1

public int AddNumbers(int number1, int number2){    int result = number1 + number2;    if(result > 10)    {    return result;    }    return 0;}

Code Example 2

public void SayHello()
{
Console.WriteLine("Hello") ;
}
//as basic as it gets 
//for a function

Code Example 3

public void SayHello(string name) 
{
    Console.WriteLine("Hello");
}

public void SayName()
{
	Console.WriteLine("What is your name?");
	string name = Console.ReadLine(); 
	SayHello(name);
}

Code Example 4

void draw() {
	//code here
}

//Calls the function every frame making nice and satisfying movement
void Update() {
	draw()
}

Code Example 5

public int AddNumbers(int number1, int number2)
{
    int result = number1 + number2;
    return result;
}

Code Example 6

public void SayHello(string name) 
{
    Console.WriteLine("Hello")  
}


Console.WriteLine("What is your name?")
string name = Console.ReadLine() ; 

SayHello(Adam)

Learn ReactJs, React Native from akashmittal.com