S
snow.carriers
Hello, I would like to know how to do this:
Basically when I input a number, such as 123, it should display 6
(1+2+3), and for 666 would be 18. I'm a bit stuck here...
I know it would involve a while loop along that can do this condition:
nd1=num/100%10;
nd2=num/10%10;
nd3=num%10;, etc
And some how add it up. Can anyone help me? Thanks.
Basically when I input a number, such as 123, it should display 6
(1+2+3), and for 666 would be 18. I'm a bit stuck here...
I know it would involve a while loop along that can do this condition:
nd1=num/100%10;
nd2=num/10%10;
nd3=num%10;, etc
And some how add it up. Can anyone help me? Thanks.