+ 3
How to remove some outputs and get only the desired output ?
https://code.sololearn.com/cHvfBD7ei33p/#cpp I designed this code to take out the sum of digits of the number the user input until we get a 1 digit number. Like 346 add up to 3+4+6=13 than 13 add up to 1+3=4 I just wanted to know how to remove the outputs that are obtained before adding all the numbers. For example- When ii enter 355 as input. the output shows 40 and 4. I just need it to print 4. and i want the program to be usable for inputs of any number of digits.
3 Answers
+ 3
thnks crocodile
0
use your outside of the while loop