Hi here is my problem i am able to input values for my matrix as such
for(i=0;i<n;i++)
{
for(j=0;j<n;j++){
scanf("%d",&a[i][j]);
how ever this is very tedious for matrices of a large order and i cant get the matrix to work with pointers and the rand function
for(i=0;i<n;i++)
{
for(j=0;j<n;j++){
&a[i][j] = -1 + rand() * (double)(2) / RAND_MAX;
this code compiles but results in errors also this with out the & operator compiles and gives me incorrect results as well
a[i][j] = -1 + rand() * (double)(2) / RAND_MAX;
what am i missing for the pointers to work as such?
Apparently
ais an array ofint(you are using"%d"to input values withscanf).The expression you use generates
doubles(ranging from-1to1) that when converted tointresult in0. I guess that’s what you see ina.Make
aan array ofdoubles.