Structure of the Problem Requirements
Loops are very important term in programming. The loops are use for the repeation of a instrcution in a programming . Condition can also be apply in loops according to the problems. Her is simple example of for loop which take five number from user and then again using for loop show that numbers.
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 Loop |
Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.
0 comments:
Post a Comment