Computer Science, asked by Pikachu82, 1 year ago

write any program in java using if condition with for loop

Answers

Answered by garywalter1221
0

@

##

@@@

####

@@@@@


This u can make by using for loop and if else condition


if the no. is odd then print #

else print @


u should try this

Answered by Anonymous
2

Answer:

class Pattern

{

   public static void main()

   {

       for(int i=4;i>=1;i--)

       {

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

           {

               if(j%2==0)

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

               else

               System.out.print((i+1)+" ");

           }

           System.out.println();

       }

       for(int i=5,k=69;i>=0;i--,k--)

       {

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

           System.out.print((char)k+" ");

           System.out.println();

       }

   }

}

Similar questions