Question: In c# how do I evenly divide 100 into 7?

So the result would be 

1. 16
2. 14
3. 14
4. 14
5. 14
6. 14
7. 14

The code below is incorrect as all 7 values are set to 15 (totalling 105).

```
        double [] vals = new double[7];
        for (int i = 0; i < vals.Length; i++)
        {
            vals[i] = Math.Ceiling(100d / vals.Length);
        }

```

Is there an easy way to do this in c#?

Thanks

Answer: 
Since this seems to be homework, here is a hint and not the full code.

You are doing Math.Ceiling and it converts 14.28 into 15.
The algorithm is this

1. Divide 100 by 7, put the result in X
2. Get the highest even number below X and put this in Y.
3. Multiply Y by 7 and put the answer in Z.
4. Take Z away from 100.

The answer is then 6 lots of Y plus whatever the result of step 4 was.

This algorithm may only work for this specific instance.

I'm sure you can write that in C#