You are viewing a single comment's thread. Return to all comments →
need some modification. If you watch closely you will find the problem
int main(){ int n,max,x; max=0; int count=0; scanf("%d",&n); while(n>0) { x=n%2; n=floor(n/2); if(x==1) { count++; } else{ if(count>max) { max=count; } count=0; } } if(max>=count){ printf("%d",max); } else { printf("%d",count); } 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 →
need some modification. If you watch closely you will find the problem