Number pattern 1,10....
public class NumberPattern10
{
/*
* 1
10
101
1010
10101
*/
public static void main(String[] args) {
int i,j,k;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(j%2);
}
System.out.println();
}
}
}
public class NumberPattern10
{
/*
* 1
10
101
1010
10101
*/
public static void main(String[] args) {
int i,j,k;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(j%2);
}
System.out.println();
}
}
}
No comments:
Post a Comment