I wrote a program to descrite a domain (1*1) to i*i cells. (i cells per edge). I want to write two arrays x[i][i] and y[i][i] for (x,y) of centers of cells. The origin is on the south west of the domain, but the program assign 0 to all of x and y array. what is the problem??????????????
int main() { int i = 10; double x[10][10], y[10][10]; //the problem is that you have division int on int. // you have transfer int into double in one of terms
for (int m=0; m < i; m++){ for(int n=0; n < i; n++){ x[m][n]=double(2*m+1)/(2*i); y[m][n]=double(2*n+1)/(2*i); } } };
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment