SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- // Switch
- // Oscar Neal 31/10/19
- #include <iostream>
- using namespace std;
- int main()
- {
- int numb = 1;
- cout << "Press 0 to exit program" << endl << endl;
- while (numb != 0) {
- cout << "Enter a number from 1 to 5: " << endl;
- cin >> numb;
- if (numb >= 1 && numb <= 5) {
- cout << "Your number is: " << numb << endl;
- } else {
- cout << "please enter a valid number" << endl;
- }
- }
- system("pause");
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.