Question: Write a function file named SUBTRACTION _ FUN that uses nested loops that will perform the following calculation until the value of y is less
Write a function file named SUBTRACTIONFUN that uses nested loops that will perform the following calculation until the value of y is less than or equal to zero. This process will be completed multiple times, each time with a new value of x
yyxx
The initial value of y will always be The loop should also keep track of the number of iterations while performing the above calculation. Once the value of y is less than or equal to zero, the final value of y and the total number of iterations should each be stored in their own vectors. These two vectors should be the outputs to your function.
The values of x that will be tested should the input to your function. Your outer loop should cycle through these values.
pts Test your function from part a with the following values of x:
x ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
