For
for (int x=0; x < myArr.Length; x++) {
Console.WriteLine(myArr[x]);
}
For Each
foreach (int a in myArr) {
total += a;
}
While
while (x < 10) {
Console.WriteLine("still");
x++;
}
Do While
do {
Console.WriteLine("still");
x++;
} while (x < 10);
Must include "using System.Linq;" when doing any Linq commands.
Functions:
public static bool myFunction(int a, int b) {
return (a == b);
}
Lists:
List<int> myList = new List<int>();
myList.Add(1);
Arrays:
string[] myArr = new string[] {"cat, "dog", "pig"}
myArr[2] = "hamster";