Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

what is the equivalent of cin>> in sage

I am familiar with C++. In C++, the syntax to give input is cin>>. What is the equivalent of cin>> in sage ? I am declaring an integer $n$ (in C++ syntax we write int n) and the user will give the value of $n$ when the program is being run.

How do I do that ?

It would be really helpful if you can give an example. (Say, the purpose of the program is to print an integr given by the user. What will be the syntax ?)

what is the equivalent of cin>> in sage

I am familiar with C++. In C++, the syntax to give input is cin>>. What is the equivalent of cin>> in sage ? I am declaring an integer $n$ (in C++ syntax we write int n) and the user will give the value of $n$ when the program is being run.

How do I do that ?

It would be really helpful if you can give an example. (Say, the purpose of the program is to print an integr integer given by the user. What will be the syntax ?)