How to give users input data to code like in C Print f & Scan f like that how to do in java ??
pls will you explian it
how it works
Quick example: start by importing java.util.Scanner, then in your function, write: int x; Scanner scan = new Scanner(System.in); System.out.print("Enter a number: "); x = scan.nextInt(); System.out.println("Your number is " + x);