You are viewing a single comment's thread. Return to all comments →
why doesn't mine work then? Seems the same to me...
int main(){ int n,x,count,max; scanf("%d",&n); x=0; max=0; count=0; while(n){ x = n%2; n = floor(n/2); if(x==1){ count++; } else{ if(count>max){ max=count; } count=0; } } printf("%d",max); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
why doesn't mine work then? Seems the same to me...