static void Main(string[] args) { int[] array = { 1, 1, 2, 3, 5, 8 }; PrintOddValues(array); ArrayExercise(); PrintOddValues(staticValues); ArrayLib._PrintOddValues(array); }
static void Main(string[] args) { Console.WriteLine("Hello Arrays!"); //method:1 to do this exercise int[] values = { 1, 1, 2, 3, 5, 8 }; //for (int i = 0; i < values.Length; i++) //{ // if (values[i] % 2 == 1) // { // Console.WriteLine(values[i]); // } //} ArrayExercise(); printOddNum(values); //callind a method from same class..need not mention class name ArrayLib.oddNums(values); //calling a method from another class: we should use "className.MethodName" }