Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

print an array C#

int[] arr = new int[9]; //initialize the array, now it's [null,null,null,...];
for (int i = 0; i < arr.Length; i++)
{
  Random rnd = new Random();
  arr[i] =rnd.Next(0, 1001);
}
for (int i = 0; i < arr.Length; i++) // print a random arr, ^
{
  Console.Write(", "+ arr[i]);
}
 
PREVIOUS NEXT
Tagged: #print #array
ADD COMMENT
Topic
Name
5+7 =