answersLogoWhite

0

import java.io.*;

class floyd

{

public static void main(String args[])

{

int i,j,k=0,l,n;

system.out.println("enter the no of iteration is"+n);

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

{

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

{

k++;

a=k%2;

system.out.println(""+a);

}

for(l=i;l<=n;l++)

{

k++;

}

system.out.println("\n")

}

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering