Arrays manipulation and sorting for development 1

workgodwinlarry 8 views 4 slides Mar 05, 2025
Slide 1
Slide 1 of 4
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4

About This Presentation

Learning C#


Slide Content

Length

Content
We can access the length of an array using .Length:
int[] numbers = { 2, 3, 1 };
Console.WriteLine("Length: " + numbers.Length);
// Output: Length: 3

Practice
Given the nums array:
int[] nums = { 2, 3, 1 };
Find out what its first value is and check its length:
Console.WriteLine("Length: " + nums.???);
// Output: Length: 3
Console.WriteLine("First Element: " + nums???);
// Output: First Element: 2
Length
[0]
[1]
size

Revision
Given the nums array:
int[] nums = { 2, 3, 1 };
Find out what its first value is and check its length:
Console.WriteLine("Length: " + nums.???);
// Output: Length: 3
Console.WriteLine("First Element: " + nums???);
// Output: First Element: 2
Length
[0]
[1]
size
Tags