self Maths Puzzle

Q. The below Java program prints the numbers from 1 to 50. But for multiples of three print "DNA" instead of the number and for the multiples of five print "RNA". For numbers which are multiples of both three and five print "ATGC". Please identify the three bugs in the code and suggest how they can be resolved.

public class SeqTest {

public static void main(String args[]) {

for(int i = 1; i

Read Solution (Total 2)

self Other Question

Q. Find the next term
1,2,4,9,125,....
Q. There are n black balls in box1 and n white balls in box2. A single operation involves transferring a ball from box1 to box2 and a ball from box2 to box1 .what is the probability that box1 has more black balls than white balls at the end of 3 operations?