Consider the array A. Write a program that computes the array B by computing the natural logarithm

Question:

Consider the array A.

3 -4 A = - 8 -1 33 -17 - 17 6. - 9


Write a program that computes the array B by computing the natural logarithm of all the elements of A whose value is no less than 1, and adding 20 to each element that is equal to or greater than 1. Do this in two ways:

a. By using a for loop with conditional statements.

b. By using a logical array as a mask.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: