Computer Science, asked by prakeerthgamer, 1 month ago

Write a program in Java to print
@
@@
@@@
@@@@
@@@@@

Answers

Answered by dhawalchaudhary418
2

Answer:

public class Sample {

   public static void main(String[] args) {

       char sign = '@';

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

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

               System.out.print(sign);

           }

           System.out.println("");

       }

   }

}

Similar questions