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
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
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
Hindi,
3 months ago
Science,
3 months ago
Computer Science,
3 months ago
Social Sciences,
8 months ago
Science,
8 months ago
English,
11 months ago
English,
11 months ago