subject
Mathematics, 05.11.2019 02:31 rostecorralmart

Write a method called printpowersof2 that accepts a maximum number as an argument and prints each power of 2 from 20 (1) up to that maximum power, inclusive. for example, consider the following calls: printpowersof2(3); printpowersof2(10); these calls should produce the following output: 1 2 4 8 1 2 4 8 16 32 64 128 256 512 1024 you may assume that the value passed to printpowersof2 is 0 or greater. (the math class may you with this problem. if you use it, you may need to cast its results from double to int so that you don't see a .0 after each number in your output. also, can you write this program without using the math class? )

ansver
Answers: 1

Other questions on the subject: Mathematics

image
Mathematics, 21.06.2019 15:20, emmanuel180
Can (3,5 and square root 34) be sides on a right triangle?
Answers: 1
image
Mathematics, 21.06.2019 17:30, JNH16
2y= 3 2 x−2 y = − 1 3 x + 1 y=− 3 1 x+1
Answers: 1
image
Mathematics, 21.06.2019 20:00, tessafargo
Prove that the value of the expression 7^8–7^7+7^6 is divisible by 43.
Answers: 1
image
Mathematics, 21.06.2019 20:20, Lindy5657
Which of the following best describes the delian problem?
Answers: 3
You know the right answer?
Write a method called printpowersof2 that accepts a maximum number as an argument and prints each po...

Questions in other subjects:

Konu
Mathematics, 21.03.2020 03:13
Konu
Chemistry, 21.03.2020 03:13