Question

Consider the following program. Input: n, an integer greater than or equal to 1 var:=1 for i=1 to n var:=var*i end for return(var) What does the program accomplish? What would happen if var was initially assigned a value greater than 1?

Fig: 1

Fig: 2

Fig: 3

Fig: 4

Fig: 5

Fig: 6

Fig: 7

Fig: 8

Fig: 9