Created
November 7, 2022 03:20
-
-
Save IntegerMan/04dcac914333fcac3988c81f36e7ca51 to your computer and use it in GitHub Desktop.
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
public int FindLargestNumber(List<int> numbers) | |
{ | |
int largest = int.MinValue; | |
if (numbers != null) | |
{ | |
foreach (int num in numbers) | |
{ | |
if (largest < num) | |
{ | |
largest = num; | |
} | |
} | |
} | |
return largest; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment