Alyssa R.

asked • 06/10/20

Computer coding

  1. What does this function do?

float function(int x) {

float result = 0.0;

float sign = 1.0 

for (int n = 1; n <x;n = n + 2) {

result = result + sign / n;

}

return 4.0 * result;

}

  1. Compute an approximation of sqrt(2)
  2. Compute an approximation of e
  3. Compute an approximation of sin(n)
  4. Compute an approximation of pi


1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.