C#: Learn by coding your own project by William S. Rothschild

C#: Learn by coding your own project by William S. Rothschild

Author:William S. Rothschild [Rothschild, William S.]
Language: eng
Format: azw3, epub
Published: 2017-06-13T04:00:00+00:00


Code:

using System;

class Program

{

static void Main()

{

string[] pets = { "dog", "cat", "bird" };

// ... Loop with the foreach keyword. foreach (string value in pets)

{

Console.WriteLine(value);

}

}

}

Output:

dog

cat

Bird

A foreach LINQ :

Code:

using System; using

System.Linq;

class Program

{

static void Main()

{

// An unsorted string array.

string[] letters = { "d", "c", "a", "b" }; // Use LINQ query syntax to sort the array alphabetically.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.