+ 5
Checkout my code and suggest me how can i shorten this?
7 Respuestas
+ 21
my try (bitwise version)
https://code.sololearn.com/cDWx71pvFez9/?ref=app
+ 11
you can do like this too
https://code.sololearn.com/cUE8u45nF05V/?ref=app
+ 5
Suggestions will be appreciated 😂😄
+ 2
void binary(int num)
{
if (num == 0)
{
cout << '0';
return;
}
for (; num != 0; num /= 2)
cout << num % 2;
}
You don't need bin (you never use it), and in this particular case, it's better to make dec unsigned.
+ 1
Suggestions will be appreciated ;)
+ 1
why you challenge me in html
0
are u learnig c pluss pluss here??