pause at 2:00
This commit is contained in:
18
C# Full Course for free/12.arrays.md
Normal file
18
C# Full Course for free/12.arrays.md
Normal file
@@ -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]
|
||||
```
|
||||
25
C# Full Course for free/13.methods.md
Normal file
25
C# Full Course for free/13.methods.md
Normal file
@@ -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")
|
||||
}
|
||||
```
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user