Maths Assignment in C