You are viewing a single comment's thread. Return to all comments →
Can Someone Find the Error in my Function
int restaurant(int l, int b) { if(0 == b % l ) { return b/l; } else { float frac = (float)b / (float)l ; int i = 1; while( (frac != (int)(frac)) ) { frac +=(float)b / (float)l; i++; } return (int)(i)*(int)(frac); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Restaurant
You are viewing a single comment's thread. Return to all comments →
Can Someone Find the Error in my Function
int restaurant(int l, int b) { if(0 == b % l ) { return b/l; } else { float frac = (float)b / (float)l ; int i = 1; while( (frac != (int)(frac)) ) { frac +=(float)b / (float)l; i++; } return (int)(i)*(int)(frac); } }