| 1. |
Answer please 13 35 5 57 7 7 79 9 9 9 9 write a logical program using nested loopany newsense will be reported. |
|
Answer» align="absmiddle" alt="\star\:\:\:\bf\large\underline\blue{Question:-}" class="latex-formula" id="TexFormula1" SRC="https://tex.z-dn.net/?f=%5Cstar%5C%3A%5C%3A%5C%3A%5Cbf%5Clarge%5Cunderline%5Cblue%7BQuestion%3A-%7D" title="\star\:\:\:\bf\large\underline\blue{Question:-}"> Write a program to display the following pattern. 1 33 555 7777 99999 import java.util.*; class Pattern { public static void main() { Scanner sc = new Scanner(System.in); System.out.print("Enter the number of rows for the pattern: "); int rows=sc.nextInt(); for(int i=1;i<=rows;i+=+) { int a=1; for(int J=1;j<=i;j++) System.out.print(a+" "); a+=2; System.out.println(); } } // end of main. } // end of class. |
|