Are we to assume that the variable I is just a typo of the variable i? In any event, since your mult() function doesn't pass any arguments by reference (with a pointer) then calling it twice in a row and assigning it over the same variable is kinda pointless isn't it?
Unless you're then doing something with that intermediary value outside of the loop, which is then just poor practice leaving it in the loop for nothing.
intermediary=mult(I,A); // Right here <-
intermediary=mult(intermediary,A) // Why assign this value? It gets replaced -'