Computer Science, asked by fayaz223961, 6 months ago

55. Consider the following program segment
i = 6720, j = 4
while((i%]) == 0)
i = i/j;
j=j+ 1;
On termination j will have the value
(1)​

Answers

Answered by pjeevannaik4
3

Answer:

i%j -> mod operation, gives the rest of a division

1 -> 6720/4 = 1680.0 so (i%j==0) is true so i = 1680, j = 5

2 -> 1680/5 = 336.0 so true so i = 336, j = 6

3 -> 336/6 = 56.0 so true so i = 56, j = 7

4 -> 56/7 = 8.0 so true so i = 8, j = 8

5 -> 8/8 = 1.0 so true so i = 1, j = 9

6 -> 1/9 = 0.111 so (i%j==0) is false so j == 9 on termination

Answer c, j == 9, explaination see above.

Answered by testdummyhere1212
2

Answer:

This code segment will not run, there will be error messages.

Explanation:

1) You have an open regular bracket and square bracket

2) "i%" is incomplete as the % operator requires two operands

Assuming those are the mistakes in the question and interpretating it as:

"while(i%j==0)"

then the output will be:

9

Similar questions