April 1, 2019
Write a program that
myArray
of int
of size 5,myArray
with the values 1, 2, 3, 4 and 5,myArray
.Now, let us write incorrect statements. Add the following statements one by one to your program, observe how C# react (that is, try to compile and execute after you added one, then remove it), and answer the following questions.
myArray = { 1, 2 ,3, 4, 5};
Console.WriteLine (myArray[5]);
myArray[5] = 12;
Console.WriteLine(myArray);
Write a program that
myArray
of int
of size 10,myArray
with the values 1, 2, 3, …, 9 and 10,myArray
.myArray
and display the result.myArray
and display the result.