5.1) DEVELOP A PROGRRAM TO PRINT COMMAND LINE ARGUMENT USING FOR LOOP. PROGRAM: class wr { public static void main(String args[]) { int i,a; i=Integer.parseInt(args[0]); for(a=0;a<=10;a++) { System.out.println(i); } } }
5.2) DEVELOP A PROGRAM TO DISPLAY MULTIPLE OF 5 BETWEEN 20 TO 70. PROGRAM: class multiple { public static void main(String args[]) { int i; for(i=20;i<=70;i++) { if(i%5==0) { System.out.println(i); } } } } OUTPUT:
5.3) DEVELOP A PROGRAM TO DISPLAY PYRAMIDS OF STARS/PATTERNS USING INCREMENT/DECREMENT. PROGRAM: class pyramid { public static void main(String args[]) { int i,j; for(i=1;i<=4;i++) { System.out.println(" "); for(j=1;j<=i;j++) { System.out.print("*"); } } } }
OUTPUT: