Skip to content

Instantly share code, notes, and snippets.

@concerned3rdparty
Last active August 29, 2015 14:24
Show Gist options
  • Save concerned3rdparty/38c7078d6cbb07e2a3a3 to your computer and use it in GitHub Desktop.
Save concerned3rdparty/38c7078d6cbb07e2a3a3 to your computer and use it in GitHub Desktop.
none
package pack;
import java.util.Scanner;
/**
* Created by asus kelebek on 13.7.2015.
*/
public class crossStars {
public static void main( String args[] )
{
Scanner input = new Scanner(System.in);
int number ;
System.out.print(" Enter Number( >= 3 and odd ) of Stars : ");
number = input.nextInt();
for (int i = 1; i <= number; i++)
{
for (int j = 1; j <= number; j++)
{
if( (i==j) || (number-j+1 == i) )
System.out.print("*");
else
System.out.print(" ");
}
System.out.println("");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment