User:Umar hayat swati

Name: Umar Hyat Student at FAST NUCES peshawar. using namespace std; class IntStack { public: IntStack(int num) { top = 0; maxelem = num; s = new int[maxelem]; } void decimal(int digit) {	  int reminder=0; while(digit>0) {		  reminder=digit%2; if (top == maxelem) { cout<<"OVERFLOW OCCUR"<<endl; return; }	 else s[top++] = reminder; digit=digit/2; }  }   void binary {	  while(top!=0) {     if (top == 0) { cout<<"an error"<<endl; return; }	 else cout<< s[--top]; }  }
 * 1) include

private: int *s; int top; int maxelem; };

void main {	IntStack obj(16); obj.decimal(100000); obj.binary; system("pause"); }