+ 2
What's problem with this code ? I Need help
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); //your code goes here Scanner scanner1 = new Scanner(System.in); int hours=scanner1.nextInt(); int tothours=days*hours; Scanner scanner2 = new Scanner(System.in); int mins=scanner2.nextInt(); /*int hours=24; int tothours=days*hours; int mins=60;*/ long totmins=tothours*mins; long totsec=totmins*mins; } }
4 Answers
+ 1
// There should be only one scanner defined / initialized.
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int days = scanner.nextInt();
//your code goes here
//Scanner scanner1 = new Scanner(System.in);
int hours=scanner.nextInt();
int tothours=days*hours;
//Scanner scanner2 = new Scanner(System.in);
int mins=scanner.nextInt();
/*int hours=24;
int tothours=days*hours;
int mins=60;*/
long totmins=tothours*mins;
long totsec=totmins*mins;
System.out.println(totmins);
System.out.println(totsec);
}
}
+ 1
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int days = scanner.nextInt();
//your code goes here
/*Scanner scanner1 = new Scanner(System.in);
int hours=scanner1.nextInt();
int tothours=days*hours;
Scanner scanner2 = new Scanner(System.in);
int mins=scanner2.nextInt();*/
int hours=24;
int tothours=days*hours;
int mins=60;
long totmins=tothours*mins;
long totsec=totmins*mins;
System.out.println(totsec);
}
}
+ 1
Thanks for helping meâș
+ 1
You are welcome and happy coding.