we have learnt about basic of array. now let's learn in more details
Common Properties of Arrays
1. Length
Returns the total number of elements
int[] numbers = { 10, 20, 30 };
Console.WriteLine(numbers.Length); // Output: 3
2. Rank
Returns the number of dimensions in an array.
int[,] matrix = new int[2, 3];
Console.WriteLine(matrix.Rank); // Output: 2
3. Sorting Array.Sort
Sorts the elements in ascending order
int[] numbers = { 30, 10, 20 };
Array.Sort(numbers);
4. Reverse array
Array.Reverse(numbers);
5. Array.IndexOf
Finds the index of a specific value
int index = Array.IndexOf(numbers, 20);
6. Array.Copy
Copies elements to another array
int[] newNumbers = new int[3];
Array.Copy(numbers, newNumbers, 3);
we have learnt about basic of array. now let's learn in more details
Common Properties of Arrays
1. Length
Returns the total number of elements
int[] numbers = { 10, 20, 30 }; Console.WriteLine(numbers.Length); // Output: 3
2. Rank
Returns the number of dimensions in an array.
int[,] matrix = new int[2, 3]; Console.WriteLine(matrix.Rank); // Output: 2
3. Sorting Array.Sort
Sorts the elements in ascending order
int[] numbers = { 30, 10, 20 }; Array.Sort(numbers);
4. Reverse array
Array.Reverse(numbers);
5. Array.IndexOf
Finds the index of a specific value
int index = Array.IndexOf(numbers, 20);
6. Array.Copy
Copies elements to another array
int[] newNumbers = new int[3]; Array.Copy(numbers, newNumbers, 3);
C# is primarily used on the Windows . NET framework, although it can be applied to an open source platform. This highly versatile programming language is an object-oriented programming language (OOP) and comparably new to the game, yet a reliable crowd pleaser.
The C# language is also easy to learn because by learning a small subset of the language you can immediately start to write useful code. More advanced features can be learnt as you become more proficient, but you are not forced to learn them to get up and running. C# is very good at encapsulating complexity.
The decision to opt for C# or Node. js largely hinges on the specific requirements of your project. If you're developing a CPU-intensive, enterprise-level application where stability and comprehensive tooling are crucial, C# might be your best bet.
C# is part of .NET, a free and open source development platform for building apps that run on Windows, macOS, Linux, iOS, and Android. There's an active community answering questions, producing samples, writing tutorials, authoring books, and more.
Copyrights © 2024 letsupdateskills All rights reserved