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