GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java-Programs/Other-Java-Programs/StarPattern.java at master · iamarav/Java-Programs Expand file tree/ Copy pathStarPattern.javaMore file actions 40 lines (27 loc) · 683 Bytes / Copy pathStarPattern.javaFile metadata and controls40 lines (27 loc) · 683 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 import java.util.Collections; import java.util.Scanner; public class StarPattern { public static void main(String[] args) { System.out.println("Program to get a star Pattern for an input.\n---"); Scanner sm = new Scanner(System.in); System.out.print("Enter an integer value: "); int val = sm.nextInt(); if (val>10 || val<1) { System.out.println("Out of limit"); end(); } else { for (int i = val; i > 0; i--) { for (int j = i; j > 0; j--) { System.out.print("*"); } System.out.print("\n"); } end(); } } private static void end() { System.out.println("---\nThe Program has ended."); System.exit(0); } } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |