C language matrix operation