write a program that asks the user to enter an hour value and minute value.the main ()function should then pass these two values to a type void function that displays. the two values in the format shown in the following sample run: enter the number of hours: 9 enter the number of minutes: 28 time 9:28
Answers
Answered by
1
HM...............................
PLEASE MARK ME AS BRAINLIEST
Answered by
0
Import java.util.*;
Class Time{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println(“Enter number of hours”);
int hr = sc.nextInt();
System.out.println(“Enter number of minutes”);
int min = sc.nextInt();
display(hr,min);
}
void display(int hr,int min){
System.out.println(hr+”:”+min);
}
}
Class Time{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println(“Enter number of hours”);
int hr = sc.nextInt();
System.out.println(“Enter number of minutes”);
int min = sc.nextInt();
display(hr,min);
}
void display(int hr,int min){
System.out.println(hr+”:”+min);
}
}
Similar questions