public class Main { public static void main(String args[]) { int x=10; System.out.println("The PreIncrement value is "+(++x)); } }
The PreIncrement value is 11
public class Main { public static void main(String args[]) { int x; x=Integer.parseInt(args[0]); System.out.println("The PreIncrement value is "+(++x)); } }
The PreIncrement value is 11
import java.util.*; public class Main { public static void main(String args[]) { int x; Scanner s=new Scanner(System.in); System.out.println("Enter x value"); x=s.nextInt(); System.out.println("The PreIncrement value is "+(++x)); } }
Enter x value
10
The PreIncrement value is 11