Created
November 6, 2012 15:01
-
-
Save Jack2/4025240 to your computer and use it in GitHub Desktop.
[C++]switch/case/break/default_example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << "Press Any Number" << endl; | |
int input; | |
cout << "My Number : "; | |
cin >> input; | |
switch(input){ | |
default : | |
cout << "Computer use only 0 & 1" << endl; | |
break; | |
case 0 : | |
cout << "You press Number 0" << endl; | |
break; | |
case 1 : | |
cout << "You press Number 1" << endl; | |
break; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment