return type of floor is float
floor() return type is double where a/b in CPP gives Integer result.
So that is why there is a problem.
u sure floor gives float ?
JIC YDK we can see your edits
not understand @urvashi plz make clear
that the thing i want to ask why two diff result for same code
because your floor(k/n) return float value, which is not acceptable by judge. You could have wrote (long long) floor(k/n) or simply k/n to get desired result.
if you don’t believe me then see this article or else CPP Docs
He is just fooling around. Don’t waste your time @cp_guy
can anyone check this code
Specifically, compare the output from the two solutions for the Test Input:
1 1 1000000
ohhhh now i got
this worked int x=floor(k/n);