Algorithm Sample - Sum of two numbers that are inserted by the user



package algorithmsample3;

import java.util.Scanner;

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

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int total=0;
        int number1=0;
        int number2=0;
     
        System.out.println("Please enter the first number:");
        number1=scan.nextInt();
     
        System.out.println("Please enter the second number:");
        number2=scan.nextInt();
     
        total=number1+number2;
     
        System.out.println("Result: "+total);
    }
}

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