FOR LOOP IN JAVA

Loops are very important terms in programming. The loops are use for the repeation of a instruction in a programming . Condition can also be apply in loops according to the problems. 

Source Code 


package com.ancodingpoint.www;
import java.util.Scanner;

public class Arrays_sorting{

 public static void main(String[] args) {

     Scanner input = new Scanner (System.in);
     int num [] = new int [5];
     for( int i =0; i<5;i++ )
     {
         System.out.println(" Enter Your Number Here......!");
         num[i] = input.nextInt();
     }
     System.out.println(" These Number are Taken with using for Loop !");
    for (int i =0; i <5; i++)
    {
        System.out.println(num[i]);
    }
    }
 }

Output of the Program

Java Programming



Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment