Home TechnologyProgrammingJava Subscribe to RSS
 

Write A Program To Print The Following Output Using The For Loop. 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5?

Answer Question

1 Answer - Sort by: Date | Rating

    You can Try this.

    class Display{
    public static void main(String[]ar){

    for(int i=1;i<=5;i++){
      for(int j=1;j<=i;j++){
       System.out.print (i);
      }
      //System.out.println();
    }
    }
    }
    0 0

    Alon_nad 

    answered 3 months ago

    Thanks
    Report
    Juhi

    Juhi

    commented 3 months ago

      Answer Question - Answers are editable for 5 min.

      If you do not Sign-in or Register your answers will be anonymous,

      your answers may also be checked before going online.

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International