+ 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

7th Jan 2021, 8:49 AM
Sana
Sana - avatar
4 Antworten
+ 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
7th Jan 2021, 9:00 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 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); } }
7th Jan 2021, 8:56 AM
Sana
Sana - avatar
+ 1
May be you missed semicolon post your code here .
7th Jan 2021, 8:50 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 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
7th Jan 2021, 9:04 AM
Sana
Sana - avatar