1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sesenic [268]
3 years ago
12

Java public class Odds { public static void main(String[] args) { printOdds(3); printOdds(17/2); int x = 25; printOdds(37 – x +1

); } public static void printOdds(int n) { for (int i = 1; i <= n; i++) { int odd = 2*i -1; System.out.print(odd + " "); } System.out.println(); } }
Write the output.
Computers and Technology
1 answer:
Serggg [28]3 years ago
5 0

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.
You might be interested in
FS EVERFI:
Snowcat [4.5K]

Answer:

A) work study program

Explanation:

Because you need experience and scholarships don't always pay, so this is the best choice.

6 0
2 years ago
Read 2 more answers
Select the correct answer from each drop-down menu.
xenn [34]

Answer:

Siftable are small independent computer that are capable of BLANK (graphics audio video)

4 0
3 years ago
Which of the following methods are acceptable for opening the Word application?
Nookie1986 [14]
The word application is used to write documents, to write and edit business letters, to save documents that will be used again...
Selecting the Word application using desktop shortcut is one possible way of opening the Word application. Another method that is acceptable for opening the Word application is selecting the Word application pinned on the task bar.


4 0
3 years ago
Which are factors that go into a project plan?
BaLLatris [955]

Answer:

The four critical factors to planning a successful project

Explanation:

5 0
3 years ago
100 tickets are sold in a raffle with one prize. John has 8 tickets, Jamie has 10 tickets, find the probability that John wins
Reika [66]

\frac{8}{100} or \frac{2}{25}
7 0
3 years ago
Read 2 more answers
Other questions:
  • The search engine that makes it easy to find high-quality Web resources by combining Internet technology with traditional librar
    9·1 answer
  • One of the most obvious initial changes in windows vista is the ____ interface
    10·1 answer
  • A restaurant has a case type that allows customer to book the dining room for events. Customers provide basic information includ
    11·1 answer
  • What can be done in order to secure a WLAN/wireless access point?
    12·1 answer
  • I need topics/suggestions for a highschool survey.
    6·1 answer
  • What's true about freedom
    12·2 answers
  • Question 1 of 30
    13·1 answer
  • The question of ________ arises when considering the way in which online marketers gather consumers’ information over the Intern
    6·1 answer
  • Made from fruit juice, water and sugar, The American version contains milk and cream and sometimes egg white​
    9·1 answer
  • Who does online school on FLVS???????????????????
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!