fork download
  1.  
  2. #include <stdio.h>
  3. int bitcount(unsigned int a){
  4. int i =0;
  5. while(a){
  6. i++;
  7. a &= (a-1);
  8. }
  9. return i;
  10. }
  11. void lower(char* str){
  12. char c;
  13. int i = 0;
  14. while ((c = str[i]) != '\0' && c!='\n'){
  15. (c > 'A' && c < 'Z') ? (str[i] = c - 'A' + 'a') : (str[i] = c);
  16. i++;
  17. }
  18. }
  19. int main(){
  20. char test[50] = "HEllo wolrd";
  21. printf(test);
  22. lower(test);
  23. printf(test);
  24. return 0;
  25. }
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
HEllo wolrdhello wolrd