Computer Science, asked by Anonymous, 1 year ago

write a program in Java to print the following pattern
❤❤❤

Attachments:

Anonymous: hiii
emondal83: Hello

Answers

Answered by Anonymous
5

class pattern

{

public static void main(String args[])

{

for(int i=1;i<=4;i++)

{

int a=i;

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

{

if(a%2==0)

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

else

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

a++;

}

System.out.println();

}

}

}

100% working

already tested!!!

Attachments:

Anonymous: thanks a lot
Similar questions