Getting this error while compiling the code

error: ‘cin’ was not declared in this scope

Have u included the namespace std along with iostream??
If not, then put this statement and try compiling again.
using namespace std;

what does this do? What is this?(using namespace std;)

Hi, Paras. The built in C++ library routines such as cin, cout are kept in the standard namespace.
std is an abbreviation of standard. Either you can use this or with every cin, cout statement, you can use std::cin…