Quantcast
Channel: DaniWeb Solved Topics
Viewing all articles
Browse latest Browse all 582

How can i make a vertical bar chart without arrays, using only loops?

$
0
0
I am beginner and still learning c++. So this was a question in my assignment to make a horizontal bar chart something like this,
Example:
Input:
   N1=>8 , N2=>6 , N3=>2 , N4=>10 , N5=>9
10       *
09       * *
08 *     * *
07 *     * *
06 * *   * *
05 * *   * *
04 * *   * *
03 * *   * *
02 * * * * *
01 * * * * *
   1 2 3 4 5

The columns are constant i.e 5 columns. This should be done without arrays as they are not allowed in the assignment and only using loops. It would be much appreciated if someone helps.

Viewing all articles
Browse latest Browse all 582

Latest Images

Trending Articles



Latest Images