For Array
int[] arr = new int[10] { 45, 3, 64, 6, 24, 75, 3, 6, 24, 45 };
int firstHighestNumber = arr[0];
for(int i = 0; i<arr.Length; i++)
{
if (arr[i]>firstHighestNumber)
{
firstHighestNumber = arr[i];
}
}
If you have a, b, c
int a = 1;
int b = 2;
int c = 3;
int d = a > b ? a : b;
return c > d ? c : d;
Else Simple C Language Funda...
Suppose you have three number X, Y, Z
Then
int X, Y, Z;
int maxVal = X;
if(Y > X)
maxVal = Y;
if(Z > X)
maxVal = Z;
return maxVal;