Section 2.11 Discussion Questions
int count = 0; for (int i = 0; i < n; i++){ for (int j = 0; j < n; j++){ count = count +1; } }
int count = 0; for (int i = 0; i < n; i++){ count = count + 1; }
int i = n; int count = 0; while (i > 0){ count = count + 1; i = i / 2; //Note: integer division }
int count = 0; for (int i = 0; i < n; i++){ for (int j = 0; j < n; j++){ for (int k = 0; k < n; k++){ count = count +1; } } }
int count = 0; for (int i = 0; i < n; i++){ count = count + 1; } for (int j = 0; j < n; j++){ count = count + 1; } for (int k = 0; k < n; k++){ count = count + 1; }
You have attempted 1 of 1 activities on this page.