+ 1
"line zero ' ; ' expected" error
I'm not sure why I'm getting this error when trying to make code for a project in the learn solo code editor
4 Réponses
+ 4
You assigned expression in wrong way. Always expression calculating then assign
//Here is my code. But I'm getting this error for any code even a simple string print
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
int hours= days * 24;
int min= hours * 60 ;
int sec= min * 60;
System.out.println(sec);
}
}
try this one
+ 2
Here is my code. But I'm getting this error for any code even a simple string print
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
int days * 24 = int hours;
int hours * 60 = int min;
int min * 60 = int sec;
System.out.Println(sec);
}
}
+ 1
May be you missed semicolon post your code here .
+ 1
You rock! Thanks that worked. My bad. I was getting confused how it said line zero error since there's no such line, but you cleared that I was just assigning it wrong. Thanks