write a program to get a pattern:
000
111
000
Answers
Answered by
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
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
Social Sciences,
6 months ago
Hindi,
6 months ago
English,
6 months ago
Physics,
1 year ago
Math,
1 year ago