:::: MENU ::::
  • Suitable for all screen sizes

  • Easy to Customize

  • Customizable fonts.

Wednesday, December 16, 2015


Subtraction of two numbers with Scanners:

import java.util.*;
public class Subtract
{
    public static void main()
    {
        Scanner sc=new Scanner(System.in);
        int a,b,result;
        System.out.println("Please enter 2 numbers");
        a=sc.nextInt();
        b=sc.nextInt();
        result=a-b;
        System.out.println("Subtraction is "+result);
    }
}

Thank you and make sure to like and comment.

0 comments:

Post a Comment

A call-to-action text Contact us