In Java:
System.out.println("Diga algo: ");
Scanner leitor = new Scanner(System.in);
String resp = leitor.nextLine(); //ou nextInt, nextDouble, etc
In C ++
cout << "Diga algo: ";
string name;
cin >> name;
How to read input from console in Node.js?