Hi, I am trying to transfer some numbers that I have generated inside an array,but I have some mistake that I am not 'seeing'. The array contents are not the same as those generated. Any help please.. Thanks a lot.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define SIZE 5
int main(void)
{
int A[SIZE];
int x;
int i;
srand( time( NULL ));
for(i=0;i<5;i++)
{
x= 1+rand() % 6; // generating a random value
A[i]=x;
printf("%10d%10d",x,A[x]);
printf("\n");
}
return 0;
}