Advertisement
JackHoughton00

Digits

Feb 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. package digits;
  2.  
  3. import java.util.Scanner;
  4. public class Digits {
  5.  
  6.  
  7. public static void main(String[] args) {
  8. Scanner input = new Scanner(System.in);
  9. int number,tens,ones =0;
  10. System.out.print("Please enter a two digit number");
  11. number=input.nextInt();
  12. tens=number/10;
  13. ones=number%10;
  14. System.out.print(tens+" is the number in the tens collumn.\n");
  15. System.out.println(ones+" is the number is the ones collumn.");
  16.  
  17.  
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement