here
By: joodumbass | Date: Nov 10 2006 22:04 | Format: C++ | Expires: never | Size: 589 B | Hits: 1592
- #include <iostream>
- #include <sstream>
- #include <string>
- using namespace std;
- int main() {
- cout<<"Enter a number between 0-127 to see it's ASCI equivelent, '-999' will terminate program:n";
- int input=0;
- char cCh;
- bool show = true;
- while (input != -999) {
- show = true;
- cin>>input;
- if ((input < 0 && input != -999) || (input > 127 && input != -999)) {
- cout<<input<<" is out of range! ";
- show = false;
- }
- cCh = static_cast<char>(input);
- if (input !=-999 && show)
- cout<<" "<<cCh<<endl;
- else
- cout<<"Thanks for using this program!n";
- }
- return 0;
- }
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago