Take input from the user program

Take input from the user program

using Java | Python | C++

Java code :

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        System.out.print("Enter a Number : ");
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();

        System.out.println("Entered Number is : " + number);

    }
}

Python code :

option = input("Enter a Number : ")
print("Entered Number is = " + option)

C++ Code:

#include <iostream>
using namespace std;

int main() {
  int x;
  cout << "Type a number: "; // Type a number and press enter
  cin >> x; // Get user input from the keyboard
  cout << "Your number is: " << x;
  return 0;
}

If you want to learn more about this article click this link ๐Ÿ‘‡

Java Input and Output Explanation

ย