Question: Using matlab program Program 2: (Powers of 7): Using loops write a function named powersOf7 that prints out powers of 7; that is 1, 7,
Program 2: (Powers of 7): Using loops write a function named powersOf7 that prints out powers of 7; that is 1, 7, 49, 343, up to a limit n. n is a number that is read from the user using 'input' function. If n is a negative number, print out 'Error: please input a positive number!' (11 points) Example: powersOf7 (-3) 'Error: please input a positive number! powersOf7 (0) no (i.e. empty) output powersOf7 (20000)1,7, 49, 343, 2401, 16807
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
