![aly95](/avatars/30788.jpg)
aly95
27.11.2019 •
Computers and Technology
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.
Solved
Show answers
More tips
- S Sport How to wrap boxing hand wraps? Everything you need to know!...
- F Family and Home How to Sew Curtain Tapes: Best Tips from Professionals...
- A Animals and plants How to Grow Lime from a Seed: Simple Tips and Interesting Facts...
- C Computers and Internet How to Create a Folder on Your iPhone?...
- G Goods and services How to sew a ribbon: Tips for beginners...
- F Food and Cooking How to Make Mayonnaise at Home? Secrets of Homemade Mayonnaise...
- C Computers and Internet Which Phone is Best for Internet Surfing?...
- F Food and Cooking Everything You Need to Know About Pasta...
- C Computers and Internet How to Choose a Monitor?...
- H Horoscopes, Magic, Divination Where Did Tarot Cards Come From?...
Answers on questions: Computers and Technology
- H History Imagine you are a student in a colonial town. write three journal entries that describe a typical day in school....
- M Mathematics Solve for (2x+3)(x-1)=0. enter the solution with highest value...
- H History Apizza restaurant sells containers of juice that it marks up 75 percent above its wholesale cost. if the restaurant marks up each container by $0.90, how much does...
- B Biology Mad cow disease is a fatal disease that destroys brain tissue. researchers have found that a prion protein, which is an abnormally constructed molecule, is responsible....
- M Mathematics Mr. martin s math test, which is worth 100 points, has 35 problems. each problem is worth either 5 points or 2 points let x = the number of questions worth 5 points....
- A Advanced Placement (AP) Who s joe? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1? 1?...
- M Mathematics How many students read at least 6 books?...
- L Law The chart above outlines the relationships central to a social contract. the declaration of independence was an action best described by which element of the chart?...
- H Health Precautions to take when hauling a trailer include all of the following except hitching to the trailer before loading it. using safety chains. letting some air out...
- M Mathematics 2. a scuba diver was exploring a reef 77.5 m below sea level. the diver ascended to the surface at a rate of 12.5 m/min....
Ответ:
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 715 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 725. In the last, we define the printOdds() function that is outside the class that prints odd numbers.Ответ:
Dell XPS 15 Its a laptop
Explanation: