Advertisement
idsystems

CPP_Practica 46 - ASCII

Jan 30th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. // Program: ascii.cc
  2. // Author:  Yoan Pinzon
  3. // Date:    Agosto 30, 2006
  4.  
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.    char c;
  12.  
  13.    cout << "ASCII" << endl;
  14.    cout << "=====" << endl;
  15.  
  16.    cout << "Entre un caracter= "; cin >> c;
  17.  
  18.    cout << c;
  19.  
  20.    if( c>=65 && c <= 90 ) c += 32; // convierte mayusculas en minusculas
  21.  
  22.  
  23.    if( c>=48 && c <= 57) cout << " es un digito" << endl;
  24.    else if( c >= 97 && c <= 122 )
  25.    {
  26.       if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
  27.       {
  28.          cout << " es vocal" << endl;
  29.       }
  30.       else
  31.       {
  32.          cout << " es consonante" << endl;
  33.       }
  34.    }
  35.    else
  36.    {
  37.       cout << " es caracter especial" << endl;
  38.    }
  39.  
  40.    return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement