Skip to content

Commit

Permalink
[fix] invalid choice
Browse files Browse the repository at this point in the history
  • Loading branch information
divshekhar committed Jan 26, 2022
1 parent 7414bcd commit 4bfe0ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/osps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ int main()
std::cin >> choice;
std::cout << "You have chosen " << scheduling_algo(choice) << std::endl;

if (!(choice >= 1 && choice <= 5))
{
std::cout << "Invalid choice. Exiting..." << std::endl;
return 0;
}

int n;
osps::Process p[100];

Expand Down

0 comments on commit 4bfe0ac

Please sign in to comment.