0

Hello Im a java Beginner and
I need a program that the output is like this:

*
**
***
**
*
and a Diamond

Can s0meone make me a program of this.. Just a simple code. Thank you so much!!

4
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by hhprado
0

We can help, but we won't do it all for you. You need to also put your pattern in code tags so the spacing isn't stripped out. Otherwise, we can't tell what the pattern is supposed to be:

[code]
paste pattern here
[/code]

Edited by happygeek: fixed formatting

0
public class diamond {
	
	public static void main(String [] args ){
		
		System.out.println("*");
		System.out.println("**");
		System.out.println("***");
		System.out.println("**");
		System.out.println("*");
		
		System.out.println("  *");
		System.out.println(" ***");
		System.out.println("*****");
		System.out.println(" ***");
		System.out.println("  *");
	}
}
0

The purpose was more than likely to do it with some sort of loop. Regardless, don't post full code solutions to entire programs.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.