you have an else statement after a for loop for(int i=3;i*i<=n;i+=2) { if(n%1==0) { System.out.println("Your number isn't prime."); } } else { System.out.println("Your number is prime!"); } ...
  • April 7, 2022
  • 0 Comments
You switched the operands in your assign statement. Switch this Math.abs(a[i]-a[i-1]) = biggestGap; to this biggestGap = Math.abs(a[i]-a[i-1]); Math.abs(a[i]-a...
  • April 6, 2022
  • 0 Comments