Friday, November 6, 2009

Need help with loops for AP computer science homework?

im kinda new to this and cannot figure out the output..can anyone show me step-by-step the process to finding the output?





the statement is:





int num=0;


while (x%26lt;10)


{ System.out.println ("The total values are: "+num);


num+=4;


}





what would be the out put of that?





thanks!

Need help with loops for AP computer science homework?
0


4


8
Reply:It wouldn't compile.





You declare the integer num initially, but then refer to the undeclared variable x in the while condition.
Reply:oops, you do not have an increment for x



flower

No comments:

Post a Comment