+ 2
How will you get the result of this program using while or do while? Just wonna compare my answers. Thank you.
int number = lowerbound; lowerbound = 2; upperbound= 10; int sum = 0; do { sum += number; ++number; } while (number <= upperbound);
15 Answers
+ 2
I dont get it do you want other people to do this in different ways or what?
+ 2
it works its working thank you sorry for disturbing you
+ 2
it works its working thank you sorry for disturbing you
+ 2
public class DoWhileLoop
{
public static void main(String[] args) {
int sum =0;
int lowerbound = 4;
int upperbound = 10;
do{
sum+=lowerbound;
++lowerbound;
System.out.println (lowerbound);
}
while (lowerbound <= upperbound);
}
}
here's the code, pls check if its wrong thank you
+ 2
thank you for your help thank you đđ
+ 1
What if lower bound is 2 and the upperbound is 10
+ 1
maybe because I'm a little confuse right now really sorry
+ 1
@Irwin Lopez yes sir
+ 1
about the post and pre increment and decrement when looping
+ 1
it works its working thank you sorry for disturbing you
+ 1
Am I right or wrong đ
0
Were are the values of lowerbound upperbound
Nothing is given
0
Fine
0
Actually @jomar want the output of this code
0
ok if you think that would help you, but you may want to ask about what specific parts do if youre confused.