1-11-121-1331 triangle program in bluej
Answers
Answered by
0
import java.util.*;
class series
{
public static void main(String[] args)
{
int i=0,j=0,a=6,k=0; for(i=0; i<a; i++) { k=1; for(j=0; j<(a+i); j++) { if(j<a-i-1) System.out.print(" "); else { System.out.print(""+k); if(j<(a-1)) k++; else k--; } } System.out.println(" "); } } }
class series
{
public static void main(String[] args)
{
int i=0,j=0,a=6,k=0; for(i=0; i<a; i++) { k=1; for(j=0; j<(a+i); j++) { if(j<a-i-1) System.out.print(" "); else { System.out.print(""+k); if(j<(a-1)) k++; else k--; } } System.out.println(" "); } } }
Similar questions