Algorithm Sample - Reprocessing the inserted value according to an algorithm


package algorithmsample9;

import java.util.Scanner;

/**
 *
 * @author Nurhak
 */
public class AlgorithmSample9 {

    public static void main(String[] args) {
        int number = 0;
        String data = "";

        try {
            Scanner scan = new Scanner(System.in);
            System.out.println("Please enter an integer value!");
            data = scan.nextLine();
            number = Integer.parseInt(data);

            for (int i = 1; i <= number * 2; i++) {
                System.out.println(i + " --> " + number);
            }
        } catch (Exception e) {
            System.err.println("An error occured! Please enter an integer value!");
        }
    }
}

Comments

Popular posts from this blog

Solution for "Can not obtain Oracle client information from registry"

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"

Getting Umbraco Content - IPublishedContent vs IContent vs Node vs Document