Functions: greeting + farewell Learn programming C# Sharp

Lesson:

Functions


Exercise:

Functions: greeting + farewell 13


Objetive:

Create a program whose Main must be like this:

public static void Main()
{
SayHello();
SayGoodbye();
}

SayHello and SayGoodbye are functions that you must define and that will be called from inside Main.


Code:

using System;
public class exercise97
{
    public static void SayHello()
    {
        Console.WriteLine("Hello!");
    }

    public static void SayGoodbye()
    {
        Console.WriteLine("Good Bye!");
    }

    public static void Main()
    {
        SayHello();
        SayGoodbye();
    }
}