I need help writing a java code help?
-
i need a java code using only 2 nested for loops to display.. 1 1 2 1 2 4 1 2 4 8 1 2 4 8 16 1 2 4 8 16 32 1 2 4 8 16 32 64 1 2 4 8 16 32 64 128 1 2 4 8 16 32 64 1 2 4 8 16 32 n 1 2 4 8 16 1 2 4 8 1 2 4 1 2 1
-
Answer:
This will do the job: for(int i = 1; i < 17; i++) { int m = (i < 9) ? i : 16 - i; for(int j = 1, k = 1; j <= m; j++, k *= 2) { System.out.print(k + " "); } System.out.println(""); }
reddrago... at Yahoo! Answers Visit the source
Related Q & A:
- I need help with a song I heard.Best solution by Yahoo! Answers
- I need help writing an objective for my resume.Best solution by resume-help.org
- I need help with a Romeo and Juliet essay.Best solution by Yahoo! Answers
- I need help choosing a camera.Best solution by Yahoo! Answers
- I need help simplifying a rational expression.Best solution by purplemath.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.