using System;
class Program
{
static void Main()
{
// Calling a subroutine (method without a return value)
GreetUser("John");
// Calling a function (method with a return value)
int sum = AddNumbers(5, 3);
Console.WriteLine("Sum: " + sum);
}
// Subroutine: GreetUser
// This method takes a name as a parameter and prints a greeting message.
static void GreetUser(string name)
{
Console.WriteLine("Hello, " + name + "!");
}
// Function: AddNumbers
// This method takes two parameters, adds them, and returns the result.
static int AddNumbers(int a, int b)
{
int result = a + b;
return result;
}
}