Question

Java please Write program that uses a loop to print the powers of 3 from 30...

Java please Write program that uses a loop to print the powers of 3 from 30 up to and including 39. (30 is 3^0 and 39 is 3^9)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
//TestCode.java
public class TestCode {
    public static void main(String[] args)
    {
        for(int i = 0;i<=9;i++){
            System.out.println((int)Math.pow(3,i));
        }
    }
}

1
3
9
27
81
243
729
2187
6561
19683
Add a comment
Know the answer?
Add Answer to:
Java please Write program that uses a loop to print the powers of 3 from 30...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT