Print Lower Hessenberg matrix of order N | Function to print the Lower Hessenberg matrix of order n ; If element is above super - diagonal then print 0 ; Print a random digit for every non - zero element ; Driver code
function LowerHessenbergMatrix ( n ) { for ( var i = 1 ; i <= n ; i ++ ) { for ( var j = 1 ; j <= n ; j ++ ) { if ( j > i + 1 ) document . write ( ' ' + " " ) ; else document . write ( Math . floor ( Math . random ( ) * 10 ) + " " ) ; } document . write ( " " ) ; } } var n = 4 ; LowerHessenbergMatrix ( n ) ;