You dont need to put resistors on both side of your keypad. And on your code conversion it seems you are just shorting a row and a column(bad practice) which could result to undesired result. (result to undesired result?? hmmm parang wrong grammar yata ako
) Now, as what nomad13 says the operation of the matrix keypad needs an output and input. Hence, consider revising your schematic and code conversion design.
-underpazz campaigns for more technical post
on technical threads
-underpazz campaigns for "no hijack policy
" on technical sections