Merge branch 'master' into scheduling

This commit is contained in:
Pratyush219 2021-10-13 10:57:29 +05:30 committed by GitHub
commit 31f0591030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,19 +36,23 @@ void show() {
int main() {
int ch, x;
do {
std::cout << "\n0. Exit or Ctrl+C";
std::cout << "\n1. Push";
std::cout << "\n2. Pop";
std::cout << "\n3. Print";
std::cout << "\nEnter Your Choice : ";
std::cout << "\nEnter Your Choice: ";
std::cin >> ch;
if (ch == 1) {
std::cout << "\nInsert : ";
std::cin >> x;
push(x);
} else if (ch == 2) {
pop();
} else if (ch == 3) {
show();
switch(ch){
case 0: break;
case 1: std::cout << "\nInsert : ";
std::cin >> x;
push(x);
break;
case 2: pop();
break;
case 3: show();
break;
default: std::cout << "Invalid option!\n"; break;
}
} while (ch != 0);