What is the exact output of the following program Show your

What is the exact output of the following program? Show your work import java.util.*; public class Numbers {public static void main(Strings[] args) {int i = 1; while(i

Solution

output:

1
2
3

2
3
4
5

3
4
5
6
7

4
5
6
7
8
9

______________________

Output:

initially i=1;

Every time the \'i\' value is incremented by 1 in the main() method.

then calling the method by passing the values as arguments

myMethod(2+1,1);

i.e myMethod(3,1);

After that the method displaying the output.

1

2

3

------------------------

when the second time calling the method then display the output

2

3

4

5

like that..

______Thank You

 What is the exact output of the following program? Show your work import java.util.*; public class Numbers {public static void main(Strings[] args) {int i = 1;
 What is the exact output of the following program? Show your work import java.util.*; public class Numbers {public static void main(Strings[] args) {int i = 1;

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site