title: when the array x[] length is more than 1 the logic doesnt work, but the array y[] can be any length
body: <p>x[] is first semester, y[] is second semester. everything works well when only one course is registered in x[], but when 2 courses are registered, the if else is messed up.
  when x[]'length is more than one,the logic doesnt work, but this array y[] can be any length, it doesnt affect the logic.</p>
  
  <pre><code>public static void PreRequist(int x[],int y[]){
      for (int i=0;i&lt;y.length;i++){
          if(y[i]==4){
              for(int j=0;j&lt;x.length;j++){
                  if(x[j]!=1){
                  toString(courseName(4),courseName(1));
                  }
              }
          }}}
  </code></pre>