You are viewing a single comment's thread. Return to all comments →
passing all test case except #testcase2.
int main() {
int n; int rem; int count=0; scanf("%d",&n); while(n!=0) { rem=n%2; n=n/2; if(rem==1) count=count+1; else if(rem==0) count=0; } printf("%d",count); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Consecutive 1's in Binary Numbers
You are viewing a single comment's thread. Return to all comments →
passing all test case except #testcase2.
int main() {