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