Computer Science, asked by TbiaSamishta, 1 year ago

1. In the code fragment below, start and end are integer values and gcd(x,y) is a function that computes the greatest common divisor of x and y. i := 0; j := 0; k := 0; for (m := start; m <= end; m := m+1){ if (gcd(m,9381) > 2){ i := i + m; k := k + m; }else{ j := j + m; k := k + m; } } At the end of the loop which of the following expresses a valid relation between i, j and k? k == i - j k == j - i k == i + j The relationship depends on start and end

Answers

Answered by aqibkincsem
0

Many programming issues (particularly on Brilliant) frequently inquire as to whether certain numbers have remarkable characteristics.


Knowing how to actualize this in the code is regularly a test and these calculations come up much of the time when managing harder programming issues.


By taking care of these issues, you build up a "munititions stockpile" of helpful calculations.

Similar questions