Computer Science, asked by Puneeth555, 11 months ago

write a program to get a pattern:
000
111
000

Answers

Answered by khushi6551
0

public class a

{

public static void main (String args[])

{

for(int I =1;i<=3;i++)

{

for (int j=1;j<=3;j++)

{

if(i%2==0)

{

System. out. print ("0"+" ");

}

else

{

System. out. print("1"+" ");

}

}

Answered by mrfake78
4

Answer:

Explanation:

public class a  

{  

  public static void main (String args[])  

  {  

     for(int I =1;i<=3;i++)  

     {  

        for (int j=1;j<=3;j++)

        {

           if(i%2==0)  

           {  

           system.out.print ("0"+" ");

           }  

          else  

          {

             System. out. print("1"+" ");  

          }  

}

Similar questions