What am I missing with this Prime number counter code using int method? // I'm beginner to Java, sorry if it...











up vote
-5
down vote

favorite












The method it takes two int int arguments.



static int primeCount(int start, int end) {
int count = 0;



for(int i = start; i <= end; i++) {
if(i == 2 || i % 2 != 0)
count++;
}

return count;


}










share|improve this question









New contributor




T. Mil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by πάντα ῥεῖ, 200_success, Sᴀᴍ Onᴇᴌᴀ, Mast, Martin R 8 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, 200_success, Sᴀᴍ Onᴇᴌᴀ, Mast, Martin R

If this question can be reworded to fit the rules in the help center, please edit the question.

















    up vote
    -5
    down vote

    favorite












    The method it takes two int int arguments.



    static int primeCount(int start, int end) {
    int count = 0;



    for(int i = start; i <= end; i++) {
    if(i == 2 || i % 2 != 0)
    count++;
    }

    return count;


    }










    share|improve this question









    New contributor




    T. Mil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.











    put on hold as off-topic by πάντα ῥεῖ, 200_success, Sᴀᴍ Onᴇᴌᴀ, Mast, Martin R 8 hours ago


    This question appears to be off-topic. The users who voted to close gave this specific reason:


    • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, 200_success, Sᴀᴍ Onᴇᴌᴀ, Mast, Martin R

    If this question can be reworded to fit the rules in the help center, please edit the question.















      up vote
      -5
      down vote

      favorite









      up vote
      -5
      down vote

      favorite











      The method it takes two int int arguments.



      static int primeCount(int start, int end) {
      int count = 0;



      for(int i = start; i <= end; i++) {
      if(i == 2 || i % 2 != 0)
      count++;
      }

      return count;


      }










      share|improve this question









      New contributor




      T. Mil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      The method it takes two int int arguments.



      static int primeCount(int start, int end) {
      int count = 0;



      for(int i = start; i <= end; i++) {
      if(i == 2 || i % 2 != 0)
      count++;
      }

      return count;


      }







      java






      share|improve this question









      New contributor




      T. Mil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      T. Mil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 10 hours ago





















      New contributor




      T. Mil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 10 hours ago









      T. Mil

      13




      13




      New contributor




      T. Mil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      T. Mil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      T. Mil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      put on hold as off-topic by πάντα ῥεῖ, 200_success, Sᴀᴍ Onᴇᴌᴀ, Mast, Martin R 8 hours ago


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, 200_success, Sᴀᴍ Onᴇᴌᴀ, Mast, Martin R

      If this question can be reworded to fit the rules in the help center, please edit the question.




      put on hold as off-topic by πάντα ῥεῖ, 200_success, Sᴀᴍ Onᴇᴌᴀ, Mast, Martin R 8 hours ago


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, 200_success, Sᴀᴍ Onᴇᴌᴀ, Mast, Martin R

      If this question can be reworded to fit the rules in the help center, please edit the question.



























          active

          oldest

          votes






















          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes

          Popular posts from this blog

          Quarter-circle Tiles

          build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

          Mont Emei