‹ Back to the paper
With reference to the program code given below, answer the following question: void fun(int n) {…
With reference to the program code given below, answer the following question:
void fun(int n)
{
int i, f;
for(i = 1, f = 1; i <= n; i++, f *= i);
System.out.print(f);
}
What is the output of the method fun() when the value of n=4?- (i)24
- (ii)72
- (iii)120
- (iv)ERROR
Answer
No answer yet.
From ISC 2022 Computer Science - Specimen paper (Semester 1), Paper 1, question 26(a).