Sample output:
Enter a Number:
5
*
**
***
****
*****
****
***
**
*
it should be like this. don't know how to do it. Sorry i'm just studying this for school purpose and badly need this.
this is my source code:
import java.io.*;
public class lopezKrizar_Triangle{
public static void main (String[]args)throws IOException{
DataInputStream kriz=new DataInputStream (System.in);
int ctr;
int ctr2;
int num;
System.out.print ("Enter a Number: ");
num=Integer.parseInt (kriz.readLine());
for (ctr=0;ctr<=num;ctr++)
{
System.out.println();
for (ctr2=0;ctr2<ctr;ctr2++)
{
System.out.print("*");
}
}
}
}
and this is only the output of mine
Enter a number:5
*
**
***
****
*****
help !






