// Conversione di un carattere da minuscolo a maiuscolo o viceversa. #include int main() { cout << endl << "*** CONVERSIONE MINUSCOLO <---> MAIUSCOLO ***" << endl << endl; char c; cout << "Inserisci un carattere: " << endl; cin >> c; short int scarto = 32; // E' equivalente fare `if (c >= 'a' && c <= 'z')'. if (c >= 97 && c <= 122) { char c_conv = c - scarto; cout << c << " -> " << c_conv << endl; } else if (c >= 65 && c <= 90) { char c_conv = c + scarto; cout << c << " -> " << c_conv << endl; } else cout << "Carattere non convertibile." << endl; return 0; }