title: Write a program with a loop that sums all odd digits of an input
body: <p>Hi I'm currently in school for Computer science and I'm having problems with two of my codes, the first one pertains to the title. I have to create a program that takes only the odd digits of an input and sums them. I honestly have no idea how to approach this, this is all I have</p>
  
  <p>Scanner in = new Scanner(System.in);</p>
  
  <pre><code>    int a;
      int b;
  
      System.out.println("Enter a number: ");
      a = in.nextInt();
  
      while (a &gt; 0) { 
          if (a.charAt(0) % 2 != 0) {
  
          }
      }
  </code></pre>
  
  <p>the second problem I have trouble with is write program with loops that computes the sum of all square between 1 and 100 (inclusive) This is the code i have </p>
  
  <pre><code>    int i=1;
      int j=0;
  
      while (i&lt;101){
        i = (i * i);
        j= (j+i);
        i++;
      }
      System.out.println(j);
  </code></pre>
  
  <p>Thanks, I've been searching through this book back and forth and found no ideas.</p>