5.01 - Functions: greeting + farewell

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.


Solution

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

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

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


Popular Posts