write a program in Java to print the following pattern
❤❤❤
Attachments:
Anonymous:
hiii
Answers
Answered by
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:
Similar questions
Math,
7 months ago
Computer Science,
7 months ago
History,
7 months ago
English,
1 year ago
Social Sciences,
1 year ago