Teaching Haryana (HPSC) Assistant Professor Mock Test 2025 Programming and Data Structure Programming in C
Assume that p and q are non-zero positive integers, the following program segment will perform -
While (p! = 0)
{
If (p>q)
p=p-q;
else,
q=q-p;
printf("%d",p);
}
1
Compute LCM of the given numbers
2
Subtract small number from large number
3
Compute GCD of the given numbers
4
The loop will run infinitely
5
Question Not Attempted