This is the program for Triangle and on place of "*" you can use any other variable as you want to print.
public class Triangle
{
public static void main(String Args[])
{
int i,j;
for(i=0;i<10;i++)
{
System.out.println(" * ");
for (j=0;j<=i;j++)
{
System.out.print(" * ");
}}
}
}
public class Triangle
{
public static void main(String Args[])
{
int i,j;
for(i=0;i<10;i++)
{
System.out.println(" * ");
for (j=0;j<=i;j++)
{
System.out.print(" * ");
}}
}
}
No comments:
Post a Comment