https://i0.wp.com/eblogarithm.com/wp-content/uploads/2016/10/Drawing-Isosceles-triangle-of-a-given-height.png?fit=640%2C360

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 99 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: