Answer:
const MAXNR=150;
let candidates = {};
for(let i=2; i<=MAXNR; i++) {
candidates[i] = true;
}
for(let p=2; p <= MAXNR; p++) {
if (candidates[p]) {
process.stdout.write(`${p} `);
// Now flag all multiples of p as false
i=2;
while(p*i <= MAXNR) {
candidates[p*i] = false;
i++;
}
}
}
Answer:
Probability of getting 3 consecutive tails in a fair coin toss:-
P(E)=0.125
Explanation:
If we toss an unbiased coin exactly three time we can have 8 outputs possible and those outputs are as following:-
- HHH
- HHT
- HTH
- HTT
- THH
- THT
- TTH
- TTT
Out of these 8 outputs we have 1 favorable outcome that is TTT.So the probability of the event is P(E)=1/8
where 8 is total number of outcomes.
Hello <span>Charlesreid9517
</span><span>
Answer: Files containing graphics are available from a variety of sources
Hope This Helps
-Chris</span>
Programs are series of instructions interpreted by a computer
- The description of the program is to compute the square of the difference between corresponding elements of two arrays
- The better version of the program is program A.
<h3>How to describe the programs</h3>
From the programs, we have the following highlights
- The program iterates from 1 to n - 1
- The iteration calculates the difference between corresponding elements of the arrays
- The difference is then squared
Hence, the description of the program is to compute the square of the difference between corresponding elements of two arrays
<h3>The better version</h3>
The better version of the program is program A.
This is so, because the program uses fewer instructions for the same task as program B
Read more about programs at:
brainly.com/question/16397886