R
rajm2019
Without using /,% and * operators. write a function to divide a
number by 3.
itoa() function is available
number by 3.
itoa() function is available
Without using /,% and * operators. write a function to divide a
number by 3.
Without using /,% and * operators. write a function to divide a
number by 3.
itoa() function is available
Hallvard B Furuseth said:Do your own homework.
CBFalconer said:d = 0;
while ((a -= 3) > 0) d++;
(I think this is such as not to be assumed the poor students work)
d = 0;
while ((a -= 3) > 0) d++;
(I think this is such as not to be assumed the poor students work)
Without using /,% and * operators. write a function to divide a
number by 3.
itoa() function is available
Without using /,% and * operators. write a function to divide a
number by 3.
itoa() function is available
Without using /,% and * operators. write a function to divide a
number by 3.
itoa() function is available
Without using /,% and * operators. write a function to divide a
number by 3.
itoa() function is available
double divide_by_3 (double x) {
return x > 0.0 ? exp (log (x) - log (3.0)) :
x < 0.0 ? -exp (log (-x) - log (3.0)) : x;
}
I like this one. I do see a minor problem for x == 0.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.