diff --git a/C# Full Course for free/12.arrays.md b/C# Full Course for free/12.arrays.md new file mode 100644 index 0000000..f9ae4e4 --- /dev/null +++ b/C# Full Course for free/12.arrays.md @@ -0,0 +1,18 @@ +# Arrays + +```C# +String[] cars = {"BMW", "Mustang", "Corvette"} + +Console.WriteLine(cars[0]) +// Output : BMW + +cars[0] = "Ferrari" +Console.WriteLine(cars[0]) +// Output : Ferrari + + +Console.WriteLine(cars.Length) +// Output : 3 + +String[] cars = new string[3] +``` diff --git a/C# Full Course for free/13.methods.md b/C# Full Course for free/13.methods.md new file mode 100644 index 0000000..bf6a8fd --- /dev/null +++ b/C# Full Course for free/13.methods.md @@ -0,0 +1,25 @@ +# Methods + +```C# +singHappyBirthday(); + +static void singHappyBirthday(){ + +Console.WriteLine("Happy birthday to you") +} +``` + +## arguments + +```C# +String name = "mrsh" +int age = 30; + +singHappyBirthday(name, age); + +static void singHappyBirthday(String namem int age){ + +Console.WriteLine("Happy birthday to you" + name) +Console.WriteLine("you are " + age + "years old") +} +``` diff --git a/C# Full Course for free/9.Loops.md b/C# Full Course for free/9.Loops.md index cff5cc5..5109122 100644 --- a/C# Full Course for free/9.Loops.md +++ b/C# Full Course for free/9.Loops.md @@ -20,3 +20,14 @@ for (int i = 0; i < 10 ; i++) Console.WriteLine(i) } ``` + +## foreach + +```C# +String[] cars = {"BMW", "Mustang", "Corvette"} + +foreach(String car in cars){ + Console.WriteLine(car) +} + +```