
1
01
101
0101
10101
plz give me code for this

Hi, friend a sample code for displaying as above is as follows :
public class FloydTriangleExample
{
public static void main(String[] args) throws Exception
{
int k=0;
System.out.println();
for(int i = 0; i <5; i++)
{
for(int j = 0; j <i; j++)
{
k = k + 1;
System.out.print(k%2);
System.out.print(" ");
}
System.out.println("");
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.