Displaying Asterisks with Numbers

I want to write a program that asks the user to enter in several digits
ex: 3,4,9,2

And then have it displayed as

3 ***
4 ****
9 *********
2 **

I thought I needed to use a for loop to do this, but the one I have written so far only displays one * for the first number entered, and doesn't display the last 3 numbers. Anyone know what I can do to get this to work? Thank you!

1
2
 for (int star=0; star<inNum; star++)
            cout<<"*";
You have to show more of your code. The loop that you do show does print inNum asterisks.
your example : 3,4,9,2. Where is the number 4 you inputted to make program know you'll input 4 numbers ?

is the input is
4
3,4,9,2 ?

If it's, maybe you cannot use usual cin.
see this,
http://stackoverflow.com/questions/14901678/reading-in-a-specific-format-with-cin

And you have 1 for-loop and 1 double-for-loop to do this, first for input, second for output.

Also, you have to use ARRAY to store your inputs.
Topic archived. No new replies allowed.