Ferdinando_Ottaviani

esercizio 3

Oct 16th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(void){
  3. char ch,c1;
  4. printf("inserisci un carattere\n");
  5. scanf("%c",&ch);
  6. if (ch>='A' && ch<='z')
  7. printf("il carattere inserito fa parte dell'alfabeto\n");
  8. else
  9. printf("il carattere inserito non e' una lettera\n");
  10. if (ch>='A' && ch<='Z'){
  11. c1= ch-('A'-'a');
  12. printf("la lettera minuscola e' %c\n",c1);
  13. }
  14. else if (ch>='a' && ch<='z'){
  15. c1=ch+('A'-'a');
  16. printf("la lettera maiuscola e' %c\n",c1);
  17. }
  18. return 0;
  19.  
  20. }
Add Comment
Please, Sign In to add comment