You are on page 1of 1

/******************************************************************************

BB code for Algorithm workbench Chp 8 prb 3


*******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SIZE 100
#define MOD 10
int main()
{
int x [SIZE];
int y [SIZE];
int i=0;
srand(time(0));
// function f to populate X.
for (i = 0; i <= SIZE -1; i++)
x[i] = rand()%MOD;

// function to display X
puts("The values of X are: ");
for (i = 0; i <= SIZE -1; i++){
printf("%d",x[i]);
//printf("\n");
}
//i = 0;
// f2 to copy X into Y.
for (i=0; i<= SIZE -1; i++)
{
y[i]=x[i];
}
// Up to here we have y.
// f3 to display Y.
printf("\n");
puts("The values of Y are: ");

for(i=0; i<=SIZE-1;i++)
printf("%d",y[i]);
return 0;
}

You might also like