Q:

Java Program to display triangle as 0, 10,101,1010

0

Program to display triangle as 0, 10,101,1010

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

public class demo1
{
public static void main(String args[])
 {
  for(int i=1;i<=4;i++){
  for(int j=1;j<=i;j++){
  System.out.print(((i+j)%2)+" ");
 }
System.out.print("\n");
}
}
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now