Drawing Isosceles Triangle of A Given Height Using Java

hey everyone so i tried write a code on drawing isosceles. if you have any easier ways to solve it do let me know…

import java.util.Scanner;
public class task{
public static void main(String args[]){
Scanner anik = new Scanner(System.in);
System.out.println(“give a line number”);
int fnum = anik.nextInt();
int b = fnum;
for(int count = 1; count <= fnum; ++count){ for(int xcount = 1; xcount < b; ++xcount){ System.out.print(" "); } for(int tcount =1; tcount <= count; ++tcount){ System.out.print("*"); } System.out.println(""); b--; } } }

(Visited 161 times, 1 visits today)
By | 2017-04-07T22:11:51+00:00 October 26th, 2016|Categories: Java, Programming|Tags: , , , , , , |0 Comments

About the Author:

Leave A Comment