Last active
April 20, 2017 19:17
-
-
Save rowanmiller/51ce554349981c7cadbe83c8cd9ae795 to your computer and use it in GitHub Desktop.
Sample Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApplication2 | |
{ | |
public class Program | |
{ | |
public static void Main() | |
{ | |
int mark = 66; | |
if (mark >= 60) | |
Console.WriteLine("Pass"); | |
else | |
Console.WriteLine("Fail"); | |
Console.WriteLine("Good bye"); | |
Console.ReadLine(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using System; | |
namespace ConsoleApplication2 | |
{ | |
public class Program | |
{ | |
public static void Main() | |
{ | |
double Temp = 19D; | |
If (Temp <> 20); | |
Console.WriteLine("The weather is moderate"); | |
Console.WriteLine("Nice weather, let us go outside"); | |
else | |
Console.WriteLine("Weather ?!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var person = new { Name = "Jeff", Age = 20 }; | |
var s = $"{person.Name} is {person.Age} year(s) old"; | |
Console.WriteLine(s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var person = new { Name = "Jeff", Age = 20 }; | |
var s = $"{person.Name:20} is {person.Age:D3} year(s) old"; | |
Console.WriteLine(s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var person = new { Name = "Jeff", Age = 20 }; | |
var s = $"{person.Name} is {person.Age} year {(person.Age == 1 ? "" : "s")} old"; | |
Console.WriteLine(s); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment