[Solved] Which of the following arithmetic expressions is identical to the expression a += b * c [closed]

A. x += y is just shorthand for x = x + y, the compiler always expands it out as such https://msdn.microsoft.com/en-us/library/sa7629ew.aspx B. C# isn’t like math where you can rearrange an equation as you wish. As such, you can’t have an expression such as a+b on the lefthand side of an assignment, which is … Read more

[Solved] Find the smallest number have 3 integer roots?

Your if condition is not correct ! Your code should be : public static void main(String [] args){ BigInteger i = new BigInteger(“2”); double sqroot, cuberoot, fifthroot; while(true) { sqroot = Math.sqrt(i.floatValue()); cuberoot = Math.cbrt(i.floatValue()); fifthroot = Math.pow(i.floatValue(),1/5.0d); System.out.print(“i = “+i); if(Math.floor(sqroot)==sqroot && Math.floor(cuberoot)==cuberoot && Math.floor(fifthroot)==fifthroot){ break; } i= i.add(new BigInteger(“1”)); } System.out.println(i); } 1 … Read more

[Solved] I can’t figure out this sequence – 11110000111000110010

There are many possible solutions to this problem. Here’s a reusable solution that simply decrements from 4 to 1 and adds the expected number of 1’s and 0’s. Loops used : 1 def sequence(n): string = “” for i in range(n): string+=’1’*(n-i) string+=’0’*(n-i) return string print sequence(4) There’s another single-line elegant and more pythonic way … Read more