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

With reference to the program code given below, answer the following question: int solve(int a, int…

Computer Science20221 markMCQ
With reference to the program code given below, answer the following question:
int solve(int a, int b)
{
    int i, l = 0;
    for(i = 1; i <= a * b; i++)
    {
        if(i % a == 0 && i % b == 0)
        {
            l = i;
            break;
        }
    }
    return l;
}
What is the method solve() performing?
  • (i)HCF of ‘a’ and ‘b’
  • (ii)Prime Factors of ‘a’ and ‘b’
  • (iii)LCM of ‘a’ and ‘b’
  • (iv)None of the above

Answer

No answer yet.

Methods

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