![]() |
|
#1
|
|||
|
|||
Diamond shaped asterisk in JAVAim having hard time studying looping statement in java and also in some different programming language, thats why i am needing some help here creating a program which is a diamond shaped asterisk the output should be like this:
1 * 2 * * * 3 * * * * * 4 * * * 5 * and also there is a participation of the user that the user must input an odd number, the odd number represents the level of the diamonds example 5, the output should be like the above output... hirs my code... i know i have a lot of mistake with my looping statement in this program... tnx in advance... JAVA Code:
the output became: * * * * * * * * * * * * * really need your help... T.T Last edited by LuciWiz : 06-Jan-2009 at 08:47.
Reason: Please insert your Java code between [java] & [/java] tags
|
|||
|
#2
|
|||
|
|||
Re: Diamond shaped asterisk in JAVAsystem.out.println will always shift the next output to the next line on the console. system.out.print() will not make the next output appear on the next line. What you need to do is:
JAVA Code:
|
|
#3
|
|||
|
|||
Re: Diamond shaped asterisk in JAVAnothing happens the output became like this:
* * * * * * * * * * * * * * but anyways tnx for your help.. |
|
#4
|
|||
|
|||
Re: Diamond shaped asterisk in JAVAReally? This is my ouptut:
Code:
|
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Scalability in Java and C++ | agx | Miscellaneous Programming Forum | 7 | 04-Feb-2006 16:35 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The