title: How to ignore some interger input in C
body: <p>I am new into solving problems in programming,this is some problem from  onlinejudge that i want to solve,</p>
  
  <p>here is the problem :</p>
  
  <p>you need to sum all of the inputs </p>
  
  <p>sample input1:</p>
  
  <p>1 -184 </p>
  
  <p>sample output1:</p>
  
  <p>-184</p>
  
  <p>sample input2 :</p>
  
  <p>10 439 298 -935 72 636 774 -509 -568 228 47</p>
  
  <p>sample output2 :</p>
  
  <p>482</p>
  
  <p>and here is my code :</p>
  
  <pre><code>main() {
  int num,sum;
  char ch;
  
  while(ch != 10) {
     scanf("%d",&amp;num);
     ch = getchar();
  
  if(num != 1 || 0 ) {
      sum += num;
      }  
    }
    printf("%d",sum);
    return 0;
  }
  </code></pre>
  
  <p>i am little bit lost here and wondering how to ignore those integer(1,0,10)
  my code worked on first sample,but not on the other one.</p>
  
  <p>any solution?</p>