PRASHNIKAप्रश्निका
‹ Back to the paper

With reference to the program code given below, answer the following question: void fun(int n) {…

Computer Science20221 markMCQ
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 method fun() performing?
  • (i)Checking for Prime Numbers
  • (ii)Product of odd numbers
  • (iii)Factors of a number
  • (iv)Finding the factorial

Answer

No answer yet.

Methods

From ISC 2022 Computer Science - Specimen paper (Semester 1), Paper 1, question 26(b).