//Vertical Bar Graph
public class BarGraph
{   public static void main(String args[])
    {   //input in range of 1-20(y-axis) for 5(x-axis) values
        char a[][]=new char[20][5];
        for(int i=0; i<5; i++)
        {   int s=(int)((Math.random()*15)+1); //input
            for(int j=19; j>=0; j--) 
            {   a[j][i]=j>=19-s?'#':' ';
            }
        }
        for(int i=0; i<20; i++)
        {   System.out.print(20-i+"\t");
            for(int j=0; j<5; j++)
            {   System.out.print(a[i][j]+"\t");
            }
            System.out.println();
        }
        System.out.println("\ta\tb\tc\td\te");
    }//main
}//class
//Note: Horizontal can be printed simply by putting Sop() in a loop.
