Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

I am writing a module. When I run the module, I want it to ask for a variable, like I can in other programing languages such as C++ or Python.

For example, in C++:

int i;
cout << "Please enter an integer value: ";
cin >> i;

I want something similar to the above in Mathematica.

share|improve this question

marked as duplicate by m_goldberg, Oleksandr R., Jens, Yves Klett, bobthechemist May 22 '14 at 20:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

How about Input? – Öskå May 22 '14 at 12:24
That is good. How can I use Input iteratively? In order to input several variables at once. – MOON May 22 '14 at 12:28
You can insert a List inside the Input[] field and it will returns this list: vars = Input[]; Head@vars will be a List if you provide {something, something else}. – Öskå May 22 '14 at 12:30
Suggest you read this tutorial. – m_goldberg May 22 '14 at 12:34
This question is relevant, too. – m_goldberg May 22 '14 at 14:18