Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: ascii.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- using namespace std;
- int main()
- {
- char c;
- cout << "ASCII" << endl;
- cout << "=====" << endl;
- cout << "Entre un caracter= "; cin >> c;
- cout << c;
- if( c>=65 && c <= 90 ) c += 32; // convierte mayusculas en minusculas
- if( c>=48 && c <= 57) cout << " es un digito" << endl;
- else if( c >= 97 && c <= 122 )
- {
- if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
- {
- cout << " es vocal" << endl;
- }
- else
- {
- cout << " es consonante" << endl;
- }
- }
- else
- {
- cout << " es caracter especial" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement