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