Answer:
The output of the given program is :
1 3 5
1 3 5 7 9 11 13 15
1 3 5 7 9 11 13 15 17 19 21 23 25
Explanation:
The description of the following program can be given as:
- In the given java program firstly we define a class that is "Odds". In this class, we define the main method. In this method, we call printOdds() function three times.
- In the first time calling, we pass 3 in the function parameter. So the function print 3 odd number that is 1 3 5.
- In the second time calling, we pass value 17/2 in function parameter which is 8. So, the function print 8 odd number that is 1 3 5 7.....15
- In third time calling we define an integer variable that is x in this variable we assign value that is 25 and call function that calculates value (37-x+1) that is 13. So, the function print 13 odd numbers that is 1 3 5 7..........25.
- In the last, we define the printOdds() function that is outside the class that prints odd numbers.