Results 1 to 3 of 3
- 09-22-2011, 07:12 PM #1
Member
- Join Date
- Sep 2011
- Posts
- 11
- Rep Power
- 0
Anyone could explain the Code.....
================================================== =========
Not really understand the code anyone could explain for me ....
================================================== =========
================================================== =========Java Code:int i, j; int a = 0, b = 4; for (i = 9; i > 0; i-=2) { System.out.println(); for (j = 0; j<a; j++){ System.out.print(" "); } for (j = 0; j < i; j++){ System.out.print("*"); } a++; } for (i = 0; i < 9; i+=2) { for (j = 0; j < b; j++){ System.out.print(" "); } if(i!=0){ for (j = 0; j <= i; j++){ System.out.print("*"); } } System.out.println(); b--;
================================================== =========Last edited by sunde887; 09-22-2011 at 10:29 PM. Reason: Added code tags, [code]...[/code]
- 09-22-2011, 07:22 PM #2
Re: Anyone could explain the Code.....
What don't you understand about it? Have you stepped through it with a debugger? Have you stepped through it with a piece of paper and a pencil?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 09-22-2011, 07:38 PM #3
Member
- Join Date
- Sep 2011
- Posts
- 11
- Rep Power
- 0
Re: Anyone could explain the Code.....
Java Code:int i, j; <------declare i &j int a = 0, b = 4;<-------declare a=0 b=4 for (i = 9; i > 0; i-=2) { < ------ i got 9 rol, i more 0 ,i -=2 System.out.println(); for (j = 0; j<a; j++){ System.out.print(" "); } for (j = 0; j < i; j++){ System.out.print("*"); } a++; } for (i = 0; i < 9; i+=2) { for (j = 0; j < b; j++){ System.out.print(" "); } if(i!=0){ for (j = 0; j <= i; j++){ System.out.print("*"); } } System.out.println(); b--;Last edited by sunde887; 09-22-2011 at 10:30 PM.
Similar Threads
-
Any one help me fix JAVA code and explain ?
By batista11b5 in forum New To JavaReplies: 4Last Post: 10-23-2010, 05:19 PM -
Please explain how this bit of code works.
By Allspark in forum New To JavaReplies: 4Last Post: 09-03-2010, 03:56 AM -
Please explain these 2 lines of code to me..
By murphaph in forum New To JavaReplies: 10Last Post: 01-19-2010, 02:11 PM -
how does this code work...explain me the execution please...
By vital parsley in forum New To JavaReplies: 3Last Post: 07-25-2008, 04:50 AM -
need to explain this code
By reached in forum New To JavaReplies: 3Last Post: 12-03-2007, 10:01 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks