Print Lower Hessenberg matrix of order N | C # implementation of the approach ; 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
using System ; class GFG { static void LowerHessenbergMatrix ( int n ) { Random rand = new Random ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= n ; j ++ ) { if ( j > i + 1 ) Console . Write ( 0 + " ▁ " ) ; else Console . Write ( rand . Next ( 1 , 10 ) + " ▁ " ) ; } Console . WriteLine ( ) ; } } static public void Main ( ) { int n = 4 ; LowerHessenbergMatrix ( n ) ; } }