Functions: greeting + farewell - Practice Exercises C# Sharp Lesson 5: Functions Exercise 5.1: 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. Source Code: C# JAVA 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(); } } Copy Exercise to ClipBoard Copy Code to ClipBoard Exercisey 5.1
More exercises for Lesson 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Next >>