Public paste
here
By: joodumbass | Date: Nov 10 2006 22:04 | Format: C++ | Expires: never | Size: 589 B | Hits: 1592

  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.  
  10. cout<<"Enter a number between 0-127 to see it's ASCI equivelent, '-999' will terminate program:n";
  11.  
  12. int input=0;
  13. char cCh;
  14. bool show = true;
  15.  
  16. while (input != -999) {
  17. show = true;
  18. cin>>input;
  19.  
  20. if ((input < 0 && input != -999) || (input > 127 && input != -999)) {
  21.         cout<<input<<" is out of range! ";
  22.         show = false;
  23. }
  24.  
  25.  
  26. cCh = static_cast<char>(input);
  27. if (input !=-999 && show)
  28. cout<<" "<<cCh<<endl;
  29.  
  30. else
  31. cout<<"Thanks for using this program!n";
  32. }
  33. return 0;
  34.  
  35. }