Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Chisisi Massri   on May 08 In Java Category.

  
Question Answered By: May Hansen   on May 08

I assume you're asking why it doesn't go into the second IF statement  (i.e. the
"if (j%2==0)" one)?

You're calculating "halfcount" in the wrong place. It gets set to zero and
stays there. The FOR loop with "j" as its control variable therefore never runs
and you never reach that IF statement at all.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on why it doesn't go into the if statement? Or get search suggestion and latest updates.


Tagged: