Write a Java program to print numbers between 1 to 100 which are divisible by 3, 5,
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a Java program to print numbers between 1 to 100 which are divisible by 3, 5, and by both.
Transcribed Image Text:
Sample Output: Divided by 3: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57 , 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, Divided by 5: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, Divided by 3 & 5: 15, 30, 45, 60, 75, 90, Sample Output: Divided by 3: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57 , 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, Divided by 5: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, Divided by 3 & 5: 15, 30, 45, 60, 75, 90,
Expert Answer:
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Write a Java program that meets the followinga. It has a abstract class that contains a student nameb. Include get() and set() methods for the abstract class where the student number is set/get;c....
-
Write a Java program that will read numbers between 1 and 14 and will output the appropriate symbol for a playing card of that rank (use switch).For cards between 2 and 10 just print the rank, for 1...
-
Write a Java program to find all pairs of elements in an array of integer values which their sum is equal to a specified number. Your program should ask user to input the array values and the...
-
The Bay City Parks and Recreation Department is considering building several new facilities, including a gym, an athletic field, a tennis pavilion, and a pool. It will base its decision on which...
-
Carry out the details to verify the decision rule change cited on p. 371 in connection with Figure 6.4.6. 1.0 Power-0.IL 1-B 0.5 Power 0.29 25.00 25.5026.00 26.50 27.00 Presumed value for
-
Folgate Co. bought 4,000 shares of German common stock at $40; 680 shares of Chile stock at $47.75; and 1,600 shares of Sweden stock at $78all as available-for-sale investments. At December 31,...
-
Plaintiffs James and Betty Tonkovich own approximately 850 acres of in Belmont County, Ohio. Plaintiffs belong to a group of landowners known as Belmont Leasing Group, which leases land for oil and...
-
Accelerator, Inc., manufactures a fuel additive, Surge, that has a stable selling price of $44 per drum. The company has been producing and selling 80,000 drums per month. In connection with your...
-
Instructions: Place the six steps of the accounting cycle in the correct order. Rank the options below. Prepare financial statements.Prepare financial statements. open choices for ranking No answer...
-
Auditor Changes at Daily Journal Corporation Charlie Munger is vice chairman of Berkshire Hathaway Inc. and is informally known as War- ren Buffett's "right arm." Munger also serves as chairman of...
-
A body weighing 64 lb is dropped from a height of 100 ft with an initial velocity of 10 ft/sec. Assume that the air resistance is proportional to the velocity of the body. If the limiting velocity is...
-
Give a short (5 - 10 minutes) presentation to a partner explaining a communication strategy, protocol or standard of your choice. This could include information related to public relations, crisis...
-
Category 7 - Diversity - Cultural Dimensions Discuss 2 divergent cultural characteristics that can be present in a group. Define these characteristics using textbook citations and provide examples to...
-
List the four (4) different communication strategies you have used while communicating with clients and co-workers?
-
Create a simple blockchain simulation in Python. Your program should be able to create new blocks, validate the integrity of the chain, and display the entire blockchain.
-
1; Journal Prompt: Different Cultures Is it ethical or appropriate for someone from one culture to attempt to change the cultural values of someone from another culture? For example, consider the...
-
A risk-averse investoralways prefers portfolio (choose one answer) a. with higher Sharpe ratio b. that is riskier c. with higher value of utility function d. with lower Sharpe ratio e. both A and C...
-
A line l passes through the points with coordinates (0, 5) and (6, 7). a. Find the gradient of the line. b. Find an equation of the line in the form ax + by + c = 0.
-
Write a program that reads a connected graph from a file. The graph is stored in a file using the same format specified in Programming Exercise. Your program should prompt the user to enter the name...
-
Following the example of the Circle class in Section 9.2, design a class named Rectangle to represent a rectangle. The class contains: Two double data fields named width and height that specify the...
-
Write a program that randomly fills in 0s and 1s into a 4-by-4 matrix, prints the matrix, and finds the first row and column with the most 1s. Here is a sample run of the program: 0011 0011 1101 1010...
-
Do you believe that fraud in the United States is more or less prevalent than fraud in countries outside the United States? Why?
-
How would a fraudster conceal missing cash, especially amounts of this magnitude?
-
Why is it difficult to convict organized crime leaders?
Study smarter with the SolutionInn App