fork download
  1. #include <stdio.h>
  2.  
  3. int countSetBits( int *n)
  4. {
  5. int count = 0;
  6. printf("%d",*n);
  7. while(*n)
  8. {
  9. count += *n & 1;
  10. *n= *n >> 1;
  11. }
  12.  
  13. return count;
  14. }
  15.  
  16. int main(void) {
  17. int n =5;
  18. int cnt= countSetBits(n);
  19. return cnt;
  20. }
  21.  
Runtime error #stdin #stdout 0s 9296KB
stdin
Standard input is empty
stdout
Standard output is empty