dividing two matrices in c

Posted 26 October 2013 - 11:13 AM

so i wrote a code to populate two matrices with random numbers. then i am supposed to multiply, dividem add and subtract the matrices. i have it all printed out and everything looks good... except my divide function isn't working to give me a fraction of a number. matrix[a] and matrix[b] are int and matrix[c] is a double.

Re: dividing two matrices in c

Posted 26 October 2013 - 12:08 PM

random numbers are defined as:

a[i][j]=rand()%49+1;

that should take care of zeros.

now, if i wanted find the numbers that were odd and print them for each part... would i just create a loop to divide by two and use the modulus operator to see if it =/0 then print the digits that falls into? would that be the most efficient way?