array question

to enter the user input in an array g[4]
suppose user enter the value g[5432] then the output is


*
**
***
****
****


i want the logic for this problem
i want the logic for this problem

Not a very good way to get help.

You aren't very descriptive we have no idea what you are trying to accomplish. All you do is mention an array of size 4 and a range of integers from 5-2 then have an output of 1,2,3,4,4 asterisks.

If you could explain more and show us your attempts we could possibly help you.

Also your title is misleading
array question
I don't see any questions.
Last edited on
I think what you trying to ask, (i may be wrong)... But you have an array of integers that is initialised from user input:

1
2
3
int a = 0;,b = 0;,c = 0;,d = 0;,e = 0;
cin>>a>>b>>c>>d>>e;
int g[4] = {a,b,c,d,e};// this of which is an array of length "5", with 5 ints in it... i.e has [0][1][2][3][4] 


and after user input you have an asterix output that looks like so

*
**
***
****
*****

and you want to know how that works???...am i right ???? :)... ::: like giblit said.. its hard to understand what your asking,, but hey... thought i should have a go at it:)
Last edited on
Topic archived. No new replies allowed.