Thursday, 11 April 2013

Challenge 1 : The star line


Write a program which takes 10 numbers 0 to 9(number may repeat any number of times) as input and display the * s where the no.of stars should be the frequency of the number in the list.
Sample Input: 1 1 2 3 1 2 1 5 7 9
Output:
          *
          *
          *        *
          *        *        *                 *                 *                 *
_        _        _        _        _        _        _        _        _        _
0        1        2        3        4        5        6        7        8        9

Here is the code I've written for the above challenge

No comments:

Post a Comment