Random Number Generator and Transposing Arrays

Published on: Thu Mar 04 2010

time(0) returns times since unix started. srand() seed the random number generator rand() get a random number t = print tab. Transpose a square array n x n. The diagonal stays the same, check in i==j. If it does, you have a diagonal number. Only swap the upper triangular half. do not touch the bottom. outer loop i = 0 to i = n-1 Inner Loop j = i+1 to j=n-1
 for (i=0; i