SHARE
TWEET

Simple Change Machine

16120 Dec 8th, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class change {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         System.out.print("Enter the amount: ");
  8.         int a = sc.nextInt();
  9.         System.out.println("Enter a price of product");
  10.         int b = sc.nextInt();
  11.         int c = a - b;
  12.         System.out.println("The rest: " + c );
  13.    
  14.    
  15.     }
  16.  
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top