pls tell me why my code gives output run time error and also explain with your code
#include
#include
using namespace std;
int main(int argc, char const *argv[]){
stack<int> s;
int no;
cin>>no;
int input;
int c;
while(no--){
cin>>input;
if(input==2){
cin>>c;
s.push(c);
}
if(input==1){
if(s.empty()){
cout<<"No Code"<<endl;
}
cout<<s.top()<<endl;
s.pop();
}
}
return 0;
}