/*----------------------------------------------------------------------*/
/*                         RandomArray.cpp                              */
/* Authored By : H.P.Kasmaei                                            */
/* Last Update : April 13, 2009                                         */
/* http://www.hpkclasses.ir/                                            */
/*----------------------------------------------------------------------*/

#include <iostream.h>
#include <stdlib.h>

main() {

   int random_array[10][10][10];
   int a, b, c;
   /* fill  the array elements with random numbers */
   for (a = 0; a < 10; a++)
      for (b = 0; b < 10; b++)
         for (c = 0; c < 10; c++)
            random_array[a][b][c] = rand();

   /* display the array elements 10 at a time */

   for (a = 0; a < 10; a++) 
      for (b = 0; b < 10; b++) {
         for (c = 0; c < 10; c++) {
            cout << "\nrandom_array[" << a << "][" << b << "][" << c << "] = ";
            cout << random_array[a][b][c];
            }
         cout << "\nPress Enter to continue, CTRL-C to quit.";
	 }
   return 0;
}


