Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Tutorial_Project_1.Tutorial_1_Examples
- {
- class Array
- {
- //When you make arrays c# will order the boxes on how many digits/words you used, for example this would
- //Make the c# sort them into 5 boxes, a[0] a[1] a[2] so on so fourth. a of 0, a of 1\\
- //Arrays always start with 0.
- static void Main()
- {
- int[] a = new int[] { 10, 20, 30, 40, 50, 60 };
- Console.WriteLine(a[3]);
- //^^ This would make 40 appear on the cmd\\
- a[4] = 55;
- Console.WriteLine(a[4]);
- //To print out all the letter/numbers in an array use for and such.\\
- //a.Length gives you the number of elements in the array.\\
- for (int i = 0; i < a.Length; i++)
- {
- Console.WriteLine("a[" + i + "] = " + a[i]); // <-- print out a then the value of i.
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement