check for previous maximum
maxi = Math . Max ( a * b * c * d , maxi ) ; } } if ( maxi == - 1 ) Console . WriteLine ( " Not ▁ Possible " ) ; else { Console . WriteLine ( " The ▁ maximum ▁ product " + " ▁ is ▁ " + maxi ) ; } }