ThoughtWorks Programming and Technical Programming Program

Using recursion print numbers of an array.

Read Solution (Total 6)

ThoughtWorks Other Question

Print prime palindromes in a given range of number.
eg. 101
The purpose of the following flow-chart is to double the number in each of the boxes: 13, 10, 7 and 4.

In order to accomplish exactly this -- no more and no less -- what is the smallest number which may be in box 14?


Box # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15











START
>
1 Add: (number in box 13) + ( number in box 13), put result into box 13.

2 Change Instruction 1: Decrease all box-numbers mentioned in it, by 3.

NO 3 Is (number in box 14) greater than the second box-number mentioned in
Instruction 1?
YES

END What is the SMALLEST number which may be in box 14?