Vidyalelo
Data Structure · Q233

Miscellaneous on Data Structures

Programming · Data Structure · question 233

Q233

Consider the following iterative implementation to find the factorial of a number. Which of the lines should be inserted to complete the below code? int main() int n = 6, i; int fact = 1; for(i=1;i<=n;i++) _________; printf("%d",fact); return 0;

A.
fact = fact + i
B.
fact = fact * i
Answer
C.
i = i * fact
D.
i = i + fact

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board