Skip to content

Instantly share code, notes, and snippets.

@cloudengineer89
Created June 18, 2018 14:25
Show Gist options
  • Save cloudengineer89/ba77b07e158ee02caae425499a786374 to your computer and use it in GitHub Desktop.
Save cloudengineer89/ba77b07e158ee02caae425499a786374 to your computer and use it in GitHub Desktop.
class ArrayEx
{
static void Main()
{
CountSheeps(true,false, true, true, true);
Console.WriteLine();
Console.ReadKey();
}
public static int CountSheeps(bool[] sheeps)
{
int counts = 0;
bool[] arr = new bool[5];
for (int i = 0; i < arr.Length; i++)
{
if (arr[i] == true)
{
counts++;
}
}
return counts;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment