Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
If a person x pays RS1000/- to a company.If x joins 3 persons say x1,x2,x3 these 3 persons each person pay 1000 to the company then x will get 10% of that amount.Then x1 joins another 3 members say x4,x5,x6 now also they pay 1000 to company then x1 will get 10% of that amount(i.e x4,x5,x6).then x will get 10% of x1 amount. like this process will continue.I do this for first person will get how much money.
----------------------------------------------------------------------------------------------------------------
static void main()
{
Console.writeline(“enter no.of levels”);
Int l=convert.toint32(console.readline());
Double sum=0;
For(int i=1;i<=l;i++)
{
Double a=math.pow(3,i);
Double b=math.pow(10,i);
Double value=1000*(a/b);
Sum=sum+value;
}
Console.writeline(“Result is ”+sum);
Console.readline();
}
---------------------------------------------------------------------------------------------------------------
But i want at each level each person will get how much money
Posted
Updated 15-Dec-14 5:00am
v2
Comments
Zoltán Zörgő 15-Dec-14 11:02am    
Why should we care what do you want? This is your homework, struggle for your note. By the way, this can be answered with a closed formula.

1 solution

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900