Computer Science, asked by worldblah, 22 hours ago

write a java program to display the following pattern:
*#*#*
*#*#
*#*
*#
*
please answer without using scanner class and just do a desk check and execute in bluej before answering....thanks in advance​

Answers

Answered by anindyaadhikari13
1

\texttt{\textsf{\large{\underline{Solution}:}}}

The given problem is solved using Java.

1. Using nested loop.

public class Pattern{

   public static void main(String s[]){

       for(int i=5;i>0;i--){

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

               if(j%2==0)

                   System.out.print("#");

               else

                   System.out.print("*");

           }

           System.out.println();

       }

   }

}

2. Using 1 loop.

public class Pattern{

   public static void main(String s[]){

       for(int i=5;i>0;i--)

           System.out.println("*#*#*".substring(0,i));

   }

}

\texttt{\textsf{\large{\underline{O{u}tput}:}}}

*#*#*

*#*#

*#*

*#

*

See attachment for verification.

Attachments:
Answered by LaRouge
23

Answer:

An antibody, also known as an immunoglobulin, is a large, Y-shaped protein used by the immune system to identify and neutralize foreign objects such as pathogenic bacteria and viruses. The antibody recognizes a unique molecule of the pathogen, called an antigenAn antibody, also known as an immunoglobulin, is a large, Y-shaped protein used by the immune system to identify and neutralize foreign objects such as pathogenic bacteria and viruses. The antibody recognizes a unique molecule of the pathogen, called an antigen

Similar questions