Question
March 30, 2007 at 12:23 AM
jaiswar_dinesh

A program in C language that generate bar chart

by jaiswar_dinesh . Updated 19 years, 5 months ago

Write a program to generate a bar chart for a list of numbers, where each number is between -10 and 10. Given a list of numbers, your program needs to first sort the numbers. Your program should then generate the bar chart where the left hand side represents the negative values and the right hand side represents the positive values (see example output below). Your bar chart should only use the *, | and space characters.

Example:
Input: 10 ?5 5 ?10 0
Sorted list: -10 -5 0 5 10
Output:
Bar Chart

|**********| |
| *****| |
| | |
| |***** |
| |**********|

This discussion is locked

All Comments