Hi,
My problem is that any program that I create involving entering of data by the user,in other words,programs having command line, std::cin>> turn themselves off and the dos window shuts down before the printing of the final calculated answer.
Note that this is not the case where the window pops for a split second,I am aware of the cin.get(); command.
For example,

#include <iostream>
int main()
{int x;
int y;
std::cout<<"I no.:";
std::cin>>x;
std::cout<<"\nII no.:";
std::cin>>y;
std::cout<<"\nSum is:<<add(x,y)<<std::endl;
cin.get();
return 0; }
int add(int x, int y)
{return (x+y) }

The program will shut itself before showing the sum.However,this will not happen if I assign values to x and y in the program itself.
Please suggest me a remedy or else all my hopes of learning c++ will be in vain.