title: How to print vertical histogram of this code using only for loops in c++?
body: <pre><code>//Program to Print Horizontal Histogram of Shape{*} 
  
  #include&lt;"iostream"&gt;
  
  using namespace std;
  
  int main() {
      int a[100],n,i,j;
  
      cout&lt;&lt;"Enter Size of Array"&lt;&lt;endl;
      cin&gt;&gt;n;
  
      cout&lt;&lt;"Enter Array Elemnts"&lt;&lt;endl;
  
      for(i=0;i&lt;n;i++) {
          cin&gt;&gt;a[i];
      }
  
      for(i=0;i&lt;n;i++) {
          for(j=0;j&lt;a[i];j++) {
              cout&lt;&lt;"* ";
          }
          cout&lt;&lt;endl;
      }
  }
  </code></pre>
  
  <p>This code is printing the histogram in horizontal direction, but I want to print it in vertical direction from bottom to top.</p>