Write a Java program to print the given pattern
Attachments:
Answers
Answered by
2
public class patternbrainly
{
public static void main(String args[])
{
int i,f;
for(i=0;i<4;i++)
{
System.out.println();
for(f=0;f<7;f++)
if(i%2==0)
{
if(f%2==0)
System.out.print("1");
else
System.out.print("0");
}
else
{
if(f%2==0)
System.out.print("0");
else
System.out.print("1");
}
}
}
}
neelbhatkar3:
if you do not understand the logic tell me I will explain it to you. hope it helps you :)
Similar questions