‹ Back to the paper
With reference to the program code given below, answer the following question: int solve(int a, int…
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 will be the output of the method solve() when the value of a=8 and b=12?- (i)4
- (ii)96
- (iii)0
- (iv)24
Answer
No answer yet.
From ISC 2022 Computer Science - Specimen paper (Semester 1), Paper 1, question 30(a).