text: Maximum determinant of a matrix with every values either 0 or n | C # program to find maximum possible determinant of 0 / n matrix . ; Function for maximum determinant ; Function to print resulatant matrix ; three position where 0 appears ; position where n appears ; Driver code
code: using System ; public class GFG { static int maxDet ( int n ) { return ( 2 * n * n * n ) ; } void resMatrix ( int n ) { for ( int i = 0 ; i < 3 ; i ++ ) { for ( int j = 0 ; j < 3 ; j ++ ) { if ( i == 0 && j == 2 ) Console . Write ( "0 ▁ " ) ; else if ( i == 1 && j == 0 ) Console . Write ( "0 ▁ " ) ; else if ( i == 2 && j == 1 ) Console . Write ( "0 ▁ " ) ; else Console . Write ( n + " ▁ " ) ; } Console . WriteLine ( " " ) ; } } static public void Main ( String [ ] args ) { int n = 15 ; GFG geeks = new GFG ( ) ; Console . WriteLine ( " Maximum ▁ Determinant ▁ = ▁ " + maxDet ( n ) ) ; Console . WriteLine ( " Resultant ▁ Matrix ▁ : " ) ; geeks . resMatrix ( n ) ; } }