Write a function called powersOfTwo that prints the first 10 powers of 2 (starting with 2). The function takes no parameters and doesn't return anything.
1
Expert's answer
2011-06-08T07:04:06-0400
public class Power {
public static void powersOfTwo() { & for (int i = 2; i<11; i++) { & System.out.println(i + " power of 2 = " + Math.round(Math.pow(2, i))); & } }
public static void main(String[] args) { & powersOfTwo(); } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment