Computer Science, asked by arjya2004, 1 year ago

solve this program as quickly as possible in java using blueJ
1
1001
100001
10000001

Answers

Answered by Anonymous
3

class floyd2

{

                public static void main(String ar[])

                {

int i, j, k = 1;

System.out.println("Floyd's triangle");

for(i=1;i<=5;i++)

{

for(j=1;j<=i;j++)

{

if ( j == 1 || j == I )

k = 1;

else

k = 0;

System.out.print(k+" ");

}

System.out.print("\n");

}

}

}

Similar questions