- #1
djeitnstine
Gold Member
- 614
- 0
Hi guys I just learned M-D arrays and was trying to execute this piece of code:
And for some reason the output keeps screwing up. I placed '1' for the first scanf and ever since then it kept printing '1'. I can post a screen shot if necessary...
thanks
Code:
//initial value of y
printf("\nTime of initial displacement - y(t): t=");
fflush(stdin);
scanf("%lf", &IVP[1][1]);
printf("\nInitial displacement - y(%.4lf)=",&IVP[1][1]);
fflush(stdin);
scanf("%lf", &IVP[1][2]);
//initial value of y_prime
printf("\nTime of initial velocity - y'(t): t=");
fflush(stdin);
scanf("%lf", &IVP[2][1]);
printf("\nInitial velocity - y'(%.4lf)=", &IVP[2][1]);
fflush(stdin);
scanf("%lf", &IVP[2][2])
And for some reason the output keeps screwing up. I placed '1' for the first scanf and ever since then it kept printing '1'. I can post a screen shot if necessary...
thanks