Advertisement
yanivtamari

firstex

May 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner s = new Scanner(System.in);
  7.         int hour;
  8.         int time;
  9.         //ask from the user what you want
  10.         System.out.println("please enter hour: ");
  11.         hour=s.nextInt();
  12.         //calc the hour
  13.         time=(hour+10)%24;
  14.         //
  15.         System.out.println("the hour is: "+time);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement