IN C#, to retrieve the value from the fourth element of array Stuff, you will need to call element with an index ________ (write the actual value/expression used in code).
0 |
||
3 |
||
4 |
||
5 |
||
four |
In C# the array inedexing starts from 0 to n-1
So, to access the fourth element of array, we have to use to index 3.
So, 3 is the answer.
Example:
using System;
class HelloWorld
{
static void Main()
{
int[] arr = {10, 20, 30, 40};
Console.WriteLine(arr[3]);
}
}
Screenshots:
Here fourth element is 40, but we used index 3 to access it.
Get Answers For Free
Most questions answered within 1 hours.