Java code containing ! In for loop -
how ! big in loop affects program.is there checking done between , big?
public int numberofmoves(int size) { int power=2; int[] moves = new int[105]; int pocet = 0; boolean big=false; (int i=1;i<105&&!big;i++) { int num=1; (int j=0;j<power;j++) num*=i; if (num>size) big=true; else { moves[pocet]=num; pocet++; } } }
! negation operator, means !true == false
, !false == true
. in case, outer loop condition "loop while i<105
, big false
"
Comments
Post a Comment