Convert the following to while loop and also find out the output for(int i=1,j=9 ; i<j ; i++ , j-=i , System.out.println(i+j));
Answers
Answered by
2
Output:
10
9
7
Converting to while loop:
int i = 1, j = 9;
while (i < j) {
System.out.print(i + j);
i++;
j -= i;
}
Answered by
1
Answer:
☺
Similar questions