how to write function in funtion in c# code example
Example 1: function c#
public int AddNumbers(int number1, int number2)
{
int result = number1 + number2;
return result;
}
Example 2: how to make a function inside a function c#
public static void Main(string[] arg) {
Console.WriteLine("hello");
void World() {
Console.WriteLine("world")
}
world();
}
/*
output:
hello
world
*/