Page 254 - CA_Blue( J )_Class9
P. 254

14                     System.out.print(" "+v);
                    15                 }

                    16                 System.out.println();
                    17             }}}


                  You will get the following output:
























                   Program 9       Write a program to input number of lines and print the following structure:
                                         A
                                         A B
                                         A B C
                                         A B C D
                                         A B C D E
                     1     class for_charpattern1

                     2         {
                     3             public static void main()

                     4             {
                     5                 int i,j,k=64;
                     6                 for(i=1;i<=5;i++)

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

                     8                     {      System.out.print((char)(k+j)+ " ");           }
                     9                     System.out.println();
                    10                 }

                    11             }
                    12         }










                   252    Touchpad Computer Applications-IX
   249   250   251   252   253   254   255   256   257   258   259