Question: 1. If the input is n=3 in the following algorithm find the output: 1. Input n 2. e

1.     If the input is n=3 in the following algorithm find the output:

  

1.     Input n

2.     e← 0

3.     f← 2

4.     for i=1 to n do                                                                                 

       4.1  f← f × i

       4.2  e= e + f

5.     output e, f  

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer The output is e 18 f 12 Input n We have n 3 e 0 Initialize e to 0 f 2 Ini... View full answer

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!