Computer Science, asked by Anonymous, 1 year ago

Please solve this JAVA PROGRAM..... 19(a)

Attachments:

Answers

Answered by Incredible29
2
Heya user ,
Here is your answer !!

_________

public class Pattern
{
public static void main ( String args [ ] )
{
for ( int i = 1 ; i <= 5 ; i ++ )
{
for ( int j = 1 ; j <= 5 ; j ++ )
{
if ( j % 2 == 1 )
System.out.print ( " * " ) ;
else
System.out.print ( " # " ) ;
}
System.out.println ( ) ;
}
}
}

_________

Hope it helps !!

Incredible29: plz follow if u lyk my answer
Anonymous: oky
Answered by karthikps
4
class Pattern1
{
static void test()
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
if(j%2!=0)
System out print("*");
else
System out print("#");
}
System out ptintln();
}
}
}
class Pattern2
{
static void test()
{
int k=5;
for(int i=5;i>=0;i--)
{
k=5;
for(int j=i;j>=0;j--)
{
System out println();
}
}
}

Hope my answer helps you;)
Similar questions