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
Serhud [2]
3 years ago
15

Complete the method, print Multiples(), that takes in a positive integer n, and another positive integer, max. Print out all the

multiples of n that are less than or equal to max. Print each multiple on a separate line. For example, if the method is called with n
Computers and Technology
1 answer:
musickatia [10]3 years ago
3 0

Answer:

public static void printMultiples(int n, int max){

    for (int i=1; i<=max; i++){

        if(i%n == 0)

            System.out.println(i);

    }

}

Explanation:

Create a method called printMultiples that takes two parameters n and max

Inside the method, create a for loop that iterates from 1 to max. If i, a number between 1 and max, % n is equal to 0, that means the number is a multiple of n, print the number.

You might be interested in
A U.S. social security number consists of a string of 9 digits, such as "444422333". Declare a char array named ssn suitable for
tatuchka [14]

Answer:

Since the question expect us to declare a C-string, the solution code is written in C as follows:

  1.    char ssn[9];
  2.    scanf("%s",ssn);

Explanation:

A C-String is a string written in C language. It is an array of characters. To declare a C-string, we use the keyword, <em>char </em>and then followed with the variable name + brackets and the number of characters in the string. For example, we can create a C-String for the SSN number as in Line 1.

To read standard input into the array, we can use C built-in function, <em>scanf(). </em>Just include a string placeholder, %s, and the variable<em> ssn </em>as arguments to <em>scanf()</em>. This will assign the string input by user to variable <em>ssn</em> as C-String.

8 0
3 years ago
Identify the careers that require a college degree
Vikentia [17]
Doctor or teacher or an engineer

8 0
2 years ago
When typing an outline, you can move a point from a lower level to a higher level by changing the list level from the outline me
Arte-miy333 [17]
A shift+Tab
I hope it’s work
6 0
2 years ago
Counselors do NOT provide which service during treatment?
Ivan

Answer:

Civil settlement

Explanation:

5 0
3 years ago
Read 2 more answers
What does different screen size have to do with the display apperance of sites?
lesantik [10]
Display quality, or fit
7 0
2 years ago
Other questions:
  • What is required for real-time surveillance of a suspects computer activity?/p Group of answer choices a. Blocking data transmis
    12·1 answer
  • FIND THE 6 ERRORS IN THIS RESUME 30 POINTS!!!!
    12·1 answer
  • HELP PLEASE!!! I do online school, someone is in another state wanting to help me. No not do my work for me but view what I view
    6·1 answer
  • What should be used to keep a tablet dry?
    13·1 answer
  • Cuantos MB son 8,192 kb?​
    13·1 answer
  • Jacob has a text file open, and he is typing on the keyboard. What is the best description of how the
    8·1 answer
  • Write a loop that continually asks the user what pets the user has until the user enters rock in which case the loop ends. It sh
    6·1 answer
  • Which bits of the address would be used in the tag, index and offset in a two-way set associative cache with 1-word blocks and a
    7·1 answer
  • How does a security information and event management system (SIEM) in a SOC help the personnel fight against security threats
    13·1 answer
  • In large organizations, database design and management is handled by a database _____.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!