+ 2

There is an error while running this JAVA code. Please help.

/* I am trying to get input and run then run the code. For example, if 6 is the input, then, 6 5 4 3 2 1 will be the output.*/ import java.util.Scanner; public class Program{ public static void main(String[] args); {Scanner x = new Scanner(System.in); System.out.println(x.nextLine());} {int x = 3;while(x > 0) {System.out.println(x);x--; } } }

17th Apr 2018, 6:12 AM
TIRTH BHAGWAT
TIRTH BHAGWAT - avatar
1 Answer