(Solved):Consider an array A = [3, 5, -4, -6, 8, 25, -17, 9, -1]. Write a program that computes array B by computing the natural logarithm of all the elements of A whose values are equal to or greater than… View Answer…

 

Question

Consider an array A = [3, 5, -4, -6, 8, 25, -17, 9, -1]. Write a program that computes array B by computing the natural logarithm of all the elements of A whose values are equal to or greater than 1 and adding 20 to each element that is less than 1. Do this by using a for loop with conditional statements. (Hint: Create a B matrix full of 1s

Scroll to top