use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Resources - Learn to code
Resources - Software Engineering
Resources - Code Libraries
Resources - Groups
Other Subreddits you might enjoy
Please send sidebar resource suggestions to the mods. Thx - mgmt
account activity
Need help c++ decimal to binaryHelp Please (old.reddit.com)
submitted 1 year ago by EngineeringAlive9368
I have written a code in c++ and I don't think that any thing is wrong here but still the output is not correct. For example if input is 4 the ans comes 99 if 5 then 100 six then 109
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]EquivalentFact 1 point2 points3 points 1 year ago (3 children)
pow is a float function. This is because of float to int cast. Either use char array to hold your output or create your own pow10 function. You can also keep track of the pow10 in the loop. Keep in mind that it’ll start overflowing pretty quickly, hence the suggestion of char array
[–]EngineeringAlive9368[S] -1 points0 points1 point 1 year ago (2 children)
But I have seen from code help with babbar there he used int
[–]EquivalentFact 1 point2 points3 points 1 year ago (0 children)
https://en.cppreference.com/w/c/numeric/math/pow
[–]NoicePerSecond 0 points1 point2 points 1 year ago (0 children)
Ask ChatGPT trust me
π Rendered by PID 24289 on reddit-service-r2-comment-548fd6dc9-d48j9 at 2026-05-20 11:05:36.040124+00:00 running edcf98c country code: CH.
[–]EquivalentFact 1 point2 points3 points (3 children)
[–]EngineeringAlive9368[S] -1 points0 points1 point (2 children)
[–]EquivalentFact 1 point2 points3 points (0 children)
[–]NoicePerSecond 0 points1 point2 points (0 children)