fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. unsigned int n;
  6. unsigned int c;
  7. for(int i=0;n;n>>1){
  8. c += n&1;
  9. }
  10. printf("%d",c);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 4820KB
stdin
Standard input is empty
stdout
Standard output is empty