title: Separate odd even from string
body: <p>The below is the question:</p>
  
  <p>Get comma separated String of numbers from user and print the set of odd numbers and even numbers.</p>
  
  <p>sample input:</p>
  
  <p>1,2,3,4,5,6,7,8,9,10</p>
  
  <p>Sample output:</p>
  
  <p>Odd Numbers:</p>
  
  <p>1,3,5,7,9</p>
  
  <p>Even Numbers:</p>
  
  <p>2,4,6,8,10</p>
  
  <p>Sample input:</p>
  
  <p>20,30,40</p>
  
  <p>Sample output:</p>
  
  <p>Even Numbers:</p>
  
  <p>20,30,40</p>
  
  <p>My code:</p>
  
  <pre><code>class OddEv{
  public static void main(String args[]){
      String s;
      Scanner in=new Scanner(System.in);
      s=in.nextLine();
      for(int i=0;i&lt;s.length();i++){
          if(s.charAt(i)%2==0){
              System.out.print(s.charAt(i));
  
          }
  
         if(s.charAt(i)%2!=0){
               System.out.print(s.charAt(i));
         }
      }
  </code></pre>
  
  <p>but I am not getting the right answer. What <strong>changes</strong>  should I bring to get the right output according to the question</p>
  
  <p>actually I don't know java very well so I don't know what to do here </p>