Sum of Digits of the Input from user : <p>I want to create a code that will get the sum of all the digits of the input,
<em>sample input: 241 sample output: 7</em>
But there are restrictions in in making the program, only the basic operations, functions should be used and no string function is to be used in getting the said sum of the digits only (loop, /, %, *,-,+)are allowed to be used.</p>

<p>The program I am thinking should start with this..</p>

<pre><code> public class SumOfDigits{
    public static void main(String args[]) throws Exception{

        Scanner input = new Scanner(System.in);
        int num = input.nextInt();

        while(){

        }
  }
}
</code></pre>
