Last active
August 29, 2015 14:24
-
-
Save concerned3rdparty/38c7078d6cbb07e2a3a3 to your computer and use it in GitHub Desktop.
none
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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