0
What's wrong in the code?
import java.util.Scanner; class variable { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("Enter your AGe"); int x = scanner.nextInt(); int y = 2 * x; System.out.printf("Yor lived %dyears old and next %d years old you will become %dyears old",x,x,y); } }
5 Respostas
+ 2
Why do you think something is wrong in it?it outputs correct answer tho
+ 1
Nothing, it works alright. Why, do you get any error message?
+ 1
Idk but it says there should be a public class.
+ 1
Works for me alright
https://code.sololearn.com/c3ulDx61BlUm/?ref=app
+ 1
Thanks👏