fork download
  1. # include <stdio.h>
  2.  
  3. void myToUpper(char s[]){
  4. int i;
  5. for(i=0; s[i]!='\0'; i++) {
  6. if('a'<= s[i] && s[i]<= 'z')
  7. s[i]=s[i]-32;
  8. }
  9. }
  10.  
  11. int main(){
  12. char s[100];
  13. scanf("%s",s);
  14. printf("%s -> ",s);
  15. myToUpper(s);
  16. printf("%s\n",s);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5300KB
stdin
aBcDe
stdout
aBcDe -> ABCDE