Java Practical No.5.pdf

  • Uploaded by: Meer Kukreja
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Java Practical No.5.pdf as PDF for free.

More details

  • Words: 101
  • Pages: 4
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:

Related Documents


More Documents from "Meer Kukreja"