how to draw a triangle in java

Solutions on MaxInterview for how to draw a triangle in java by the best coders in the world

showing results for - "how to draw a triangle in java"
Micah
09 Apr 2017
1public static void main(String[] args) {
2/*
3         *
4         * *
5         * * *
6         * * * *
7         * * * * *
8         * * * * * *
9         * * * * * * *   */
10
11     int z = 1;
12     while (z<=7){ // z value repeat
13
14         int i = 1;
15         while (i <= z){
16             System.out.print("* ");
17             i++;
18         }
19             System.out.println();
20             z++;
21     }
22        System.out.println("==============");
23
24        int z2 = 7;
25        while (z2 >= 1){ // z value repeat
26
27            int i2 = 1;
28            while (i2 <= z2){
29                System.out.print("* ");
30                i2++;
31            }
32
33            System.out.println();
34            z2--;
35        }
36
Romina
11 Mar 2018
1graphics.drawPolygon(new int[] {10, 20, 30}, new int[] {100, 20, 100}, 3);
2// Graphics.drawPolygon(x-coordinates, y-coordinates, # of points);
queries leading to this page
2a triangle in javatriangle javatriangle javahow to create triangle in javadraw triangle in javahow to make a triangle pattern in javadraw triangle jfram javajava triangle exampletriangle class in javajava 2a triangle formulahow to code a triangle in javajava triangle codetriangle code in javamake triangle javafor triangle program for java 23 2a triangle in javatriangle java awttriangle java swinghow to create a triangle in javadraw a polydon triangle in javatriangle java 5ctriangle constructor javajava draw a trianglecode for drawing a triangle using in javajava gui application that draws trianglehow to code a triangle in java 5chow to draw a triangle javahow to make a triangle javajava triangle formuladraw triangle java awt triangle javahow to make the triangle in javajava trianglebuild triangle java function 24 triangle in javadrawing triangle starts java 7etriangle formula in java 22triangle java 22 shape javadraw triabgle in javahow to draw a triangle in javatriangle formed in javajava draw triangle shape 22triangle java 22java designing a triangledraw triangle in triangle by java graphicshow to draw triangle javadraw triangle javajava custom draw trianglehow to draw triangle in javahow to draw a triangle in java swingjava graphics draw trianglehow to make a triangle with point javadraw a triangle in javatriangle graphics javahow to draw a triangle in java with stddrawhow to draw triangle java swinghow to draw a triangle in java graphicstriangle in javahow to make triangle in javatriangle type program in javajava graphics trianglejava triangle functionjava draw trianglehow to make a triangle with points javahow to draw a triangle in javasdraw triangle in java awtcode for drawing a triangle using in java using drawtriangle methodpoint in triangle javahow to create a right triangle javatriangle program in javahow to make a triangle in javatriangle area in javahow to draw a triangle in java