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
English,
5 months ago
Chemistry,
5 months ago
Computer Science,
11 months ago
Physics,
1 year ago
Math,
1 year ago