User Profile
Collapse
-
My apologies. It was just a practice problem, but like you said, someone else might use it as a homework solution. I did not realize that until just now. I'll look over the guidelines to make sure it doesn't happen again. Thank you again! -
I got it to work. I don't know what a loop statement is, because we just learned operators, but this works so it should be acceptable. not pretty, but it gets the job done. What do you think?
<Code Snipped>
Thank you so much for all your help!Leave a comment:
-
I know the modulus operator finds the remainder when you divide one number by another, but I don't really understand what that has to do with adding the digits. And what is mod 10?Leave a comment:
-
How to write a program which sums the digits of a 4-digit number?
Hi. How do I write a program that sums the digits of a 4-digit number? I have a program that works, but you have to input the digits separately. Can anyone help or possibly explain what I'm doing wrong? My professor told us as a hint to use the modulus sign (%), but i don't know how I would use that here. My code so far is below:
...Code:#include <iostream> using namespace std; int main(void)
No activity results to display
Show More
Leave a comment: