76 785
Assignments Done
Successfully Done
In June 2019

Answer to Question #32220 in C++ for amin

Question #32220
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??????????????

for (int m=0; m<i; m++){
for(int n=0; n<i; n++){
Expert's answer
#include <iostream>
using namespace std;

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++){

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions