I solved the attached question in two ways an got different answers

the first is by calculating the unit vector of v and then using the formula (c.v)v

the second is by using the formula {(c.v)/(|v|^2)}(v)

which is the correct answer and why?