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]
2 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]2 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
Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is currently serving a request at cylinder 2,050,
cluponka [151]

Answer:

a. 18102

b. 5656

c. 6090

Explanation:

Pleaae kindly check attachment for the detailed and step by step solution of the given problem.

7 0
2 years ago
All of the following are helpful test taking strategies EXCEPT_______________.
guajiro [1.7K]
Complete The test as quickly as possible
6 0
2 years ago
Read 2 more answers
Where is NumPy used?
Svetradugi [14.3K]

Explanation:

The ndarray (NumPy Array) is a multidimensional array used to store values of same datatype. These arrays are indexed just like Sequences, starts with zero.

7 0
3 years ago
Read 2 more answers
You are creating a story map about Mexico. After configuring the web app template, you launch the app to test it. When the app o
navik [9.2K]
Nbdjsksjsidjdjwkwejd
3 0
3 years ago
PLEASE HELP TAKING TEST NOW!!! Of the following websites, the least trustworthy is one that (1 point)
Rom4ik [11]

Here's all the right answers.

1. What is the main purpose of a graphic organizer?

Answer: B

2. Which of the following website publishers would be considered an authoritative source about the cultures of ancient Mesopotamia?

Answer: C

3. Which of the following websites is the least biased?

Answer: D

4. Which of the following is true about graphic organizers?

Answer: A

5. Of the following websites, the least trustworthy is one that...

Answer: C

6 0
3 years ago
Other questions:
  • A technology _____ begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is
    13·1 answer
  • The domain name service (dns is a distributed database that allows users to communicate with each other computers by:
    7·1 answer
  • 802.11ac provides an advantage over 802.11n by incorporating increased channel bonding capabilities. What size bonded channels d
    10·1 answer
  • En que se diferencia el software y el hardware
    7·2 answers
  • Write an expression that computes the integer average of the int variables exam1 and exam2 (both declared and assigned values).
    15·1 answer
  • Me inculparon de crear una cuenta en Facebook y colocaron el barrio donde vivo, ¿cómo podría demostrar lo contrario? Ayuda urgen
    6·1 answer
  • Trace the evaluation of the following expressions, and give their resulting values. Make sure to give a value of the appropriate
    11·1 answer
  • Explain how a stored procedure is processed by the DBMS query processor (including the type of return value after the query is p
    15·1 answer
  • 15. You read a news article that's politically biased and not well organized. It's
    6·1 answer
  • When trying to upload assignment on canvas wont let me click choose file.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!