8:07 pm - Tuesday April 23, 2019

Java program using for loop and Display the 10 Numbers

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**

*@author :CandidJava.com

*@descriptions : This program explain how to display the10 Numbers using for loop

*/

import java.util.*;

class Display  {

public static void main(String args[])  {

//Assign the value for n as 10 to display 10 numbers

int i,n=10;

//Creating the for loop to display 10 numbers from 1-10

for(i=1;i<=n;i++){

System.out.println(i);

}

}

}

Output:

D:\ code>java> javac Display.java

D:\ code>java> java Display

1

2

3

4

5

Filed in: Z-A All Java Codes

No comments yet.

Leave a Reply