using static System.DateTime;
using static System.Console;
public class Program
{
public static void Main()
// Declare and assing the variable "hour" from the current date time now's .Hour property.
// The hour component, expressed as a value between 0 and 23.
var hour = Now.Hour;
// Just to see what time it is that we're working with, print now and the hour...
WriteLine(Now);
WriteLine($"Hour {hour}");
if (hour < 12) // From midnight to 11 AM...
WriteLine("Good morning!");
}
else if (hour < 16) // We know that it is 12 or greater and less than 16
WriteLine("Good afternoon!");
else if (hour < 18) // We know that it is between 16 and 18
WriteLine("Good evening!");
else // We know it is 18 or above
WriteLine("Good night!");