Computer Science, asked by hu9533152, 5 months ago

write a program that
gets 10
integers and print their Histogram '$' in c++language​

Answers

Answered by yadavjii64
2

Explanation:

Program to make a histogram of an array

Given an array of integers, print histogram of array values.

Examples:

Input : 0 11 2 13 5 12 8 11 12 9

Output :

13 | x

12 | x x x

11 | x x x x x

10 | x x x x x

9 | x x x x x x

8 | x x x x x x x

7 | x x x x x x x

6 | x x x x x x x

5 | x x x x x x x x

4 | x x x x x x x x

3 | x x x x x x x x

2 | x x x x x x x x x

1 | x x x x x x x x x

0 | x x x x x x x x x x

---------------------------------------

0 11 2 13 5 12 8 11 12 9

Input : 10 9 12 4 5 2 8 5 3 1

Output :

12 | x

11 | x

10 | x x

9 | x x x

8 | x x x x

7 | x x x x

6 | x x x x

5 | x x x x x x

4 | x x x x x x x

3 | x x x x x x x x

2 | x x x x x x x x x

1 | x x x x x x x x x x

0 | x x x x x x x x x x

---------------------------------------

10 9 12 4 5 2 8 5 3 1

Similar questions