Friday, October 22, 2021

Print 1 to 100 Using For Loop in Java

 A simple program that I wrote using Java programming to display numbers from 1 to  100 using for loop statement.

  I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Program Listing

package test;

public class Print_1_T_100 {

public static void main(String[] args) {
// TODO Auto-generated method stub
        int counter=0;
  System.out.println("\n");
      System.out.println("\tPrint 1 To 100 Using For Loop in Java");
      System.out.println();
      System.out.print("\t");
      for (int a=1; a<=100; a+=1) {

          counter++;

         System.out.print("" + a +" ,");

        

         if(counter == 25){

             

          System.out.print("\n\t");

          counter = 0;

      }

     }
      
      System.out.println("\n");
      System.out.println("\tEnd of Program");
      System.out.println("\n\n");
}

}

No comments:

Post a Comment