Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Created June 9, 2019 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/530d7dadd25394466093fa416ca2788e to your computer and use it in GitHub Desktop.
Save techthoughts2/530d7dadd25394466093fa416ca2788e to your computer and use it in GitHub Desktop.
// This is a comment
/*
This is a section of comments
*/
Console.Read(); //this is an inline comment
int aNumber = 0; //declare value type variable
//casting
float num1 = 20.9;
decimal num2 = (decimal) num1;
//arrays
int[] userAge = {21, 22, 23, 24, 25}; //initialize at point of decleration
//initialize later
int[] userAge2;
userAge2 = new [] {21, 22, 23, 24, 25};
userAge.Length
Array.Sort(userAge);
Array.IndexOf(userAge ,21) //index of first value found
5==5 && 2>1 && 3!=7
5==5 || 2<1 || 3==7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment