Advertisement
16120

Simple Change Machine

Dec 8th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement