Personally, I explicitly put braces for all my for-loops and if-statements. You've forgotten several of them, and that's causing your problems. Your outer loops have control variable 'c' - but because you've forgotten to close your braces you're reusing 'c' in an inner loop.
In addition, your indenting is all over the place, so obscuring the issue. In your IDE, find the auto-indent function - it's your friend, and will probably highlight it for you.
So, you should have :
for ( c = 0 ; c < m ; c++ ) {
for ( d = 0 ; d < q ; d++ ) {
System.out.print(multiply[c][d]+"\t");
}
System.out.print("\n");
} // missed this one
int sum[][] = new int[m][n]; // Sum is calculated.
for ( c = 0 ; c < m ; c++ ) {
for ( d = 0 ; d < n ; d++ ) {
System.out.println("The sum of the two matrices is: ");
etc