Q21.If `n` is a positive integer, what is the output of the following code? Assume that natural numbers start from 1, that is, 0 is not a natural number.
```
a = n
for i in range(1, n):
a = a + i
b = a
for j in range(1, a):
b = b * j
print(b)
```
Save
Check
Details
Q21
16 Oct 2022
Q21.If `n` is a positive integer, what is the output of the following code? Assume that natural numbers start from 1, that is, 0 is not a natural number.
```
a = n
for i in range(1, n):
a = a + i
b = a
for j in range(1, a):
b = b * j
print(b)
```