Question: Modify the program from task 10 so that instead of continuing until 0 is entered, the program first prompts the user to enter how

Modify the program from task 10 so that instead of continuing until

 0 is entered, the program first prompts the user to enter how 

Modify the program from task 10 so that instead of continuing until 0 is entered, the program first prompts the user to enter how many numbers are to be entered, and then reads in exactly this many numbers (and performs the same calculations). (* denotes mandatory exercises) a=1; while true x (a) input ('Enter a number: '); if x (a) == 0 break end a=a+1; end x= x (1:a-1); product prod (x); fprintf('the product is %d ',product); s=sum(x); fprintf('the sum is %d: ', s); mmean (x); fprintf('the mean is f: ', m); maximum max (x); fprintf('the max is %d: ', maximum); minimum min (x); fprintf('the min is f: ' minimum);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!