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
Kamila [148]
3 years ago
11

g Write a program that prompts the user to enter two integers. The program outputs how many numbers are multiples of 3 and how m

any numbers are multiples of 5 between the two integers (inclusive).
Computers and Technology
1 answer:
finlep [7]3 years ago
3 0

Answer:

number1=int(input("Enter first smallest integer number: "))#take the first integer from the user.

number2=int(input("Enter the second greatest integer number: "))#Take th esecond integer from the user.

if(number1>number2):#if condition

   print("The number is wrong, please try again")

else:

   multiple_of_3=0 #take a variable to count the multiple of 3.

   multiple_of_5=0 #take a variable to count the multiple of 5.

   while(number1<=number2):#while loop.

       if(number1%3==0):#if condition to count the multiple of 3.

           multiple_of_3=multiple_of_3+1#operation to count the multiple of 3.

       if(number1%5==0):#if condition to count the multiple of 3.

           multiple_of_5=multiple_of_5+1#operation to count the multiple of 3.

       number1=number1+1

   print("There are "+str(multiple_of_3)+" number are multiple of 3 and "+str(multiple_of_5)+" are multiple of 5")#print the count.

Output:

  • If the user gives the input 1 and 15, then it will print 5 for 3 multiple and 3 for 5 multiple.
  • If the user gives the input as 7 and 15, then it will print 3 for a multiple of 3 and 2 for a multiple of 5.

Explanation:

  • The above code is in python language, which is used to count the number of 3 multiple and 5 multiple.
  • There is a while loop that runs from the smallest number to greatest number and the check the number that it is a multiple of 5 and 3 or not by the help of if condition.
  • If it is multiple of 3, then multiple_of_3 variable is incremented by 1 and if it is a multiple of 5 then the multiple_of_5 is incremented by 1.
You might be interested in
Polls shows that most Americans....
Len [333]
I dont know whats the contexts behind this uestion but i think the answer is B
6 0
3 years ago
Which of the below statements describes the purpose of HTML 5 - check as many as apply
rewona [7]

Answer: 2) To provide instruction for how the structure     should look

              4) To provide instruction for how the content should look

Explanation:

HTML 5 is a hypertext markup language revision which basically provide the structure and content to the page. It is a standard programming which basically describe the content of the web page. It reduce the overall development time and it is faster.

In the remaining option, It does not provide any meaning as we cannot add structure directly we should use the CSS styling for the particular document.

Therefore, (2) and (4) option are correct.

4 0
3 years ago
Floating point numbers?
blondinia [14]

Answer:

Thank you so much!!!

God bless you!!!

You the best!!!

Explanation:

4 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
Molodets [167]

Answer:

Increase/decrease indent

Explanation:

8 0
2 years ago
What economic impact will this disaster have on people? Select three options.
Naily [24]

Answer:

1, 3, and 4

Explanation:

Those are the only ones that has anything to do with money.

7 0
2 years ago
Other questions:
  • Describe a situation where it would be advantageous to use the copper tape or aluminum foil instead of the A and B push buttons
    7·2 answers
  • A School is interested in computerizing their students&lt;br /&gt;grading system.&lt;br /&gt;I Marks Grade&lt;br /&gt;150-100 A&
    11·1 answer
  • What’s the answer of Dennis Brylow’s computer science
    15·1 answer
  • Write a program in C++ or C that includes two different enumeration types and has a significant number of operations using the e
    15·1 answer
  • Which are guidlines for using themes? Check all that apply
    13·1 answer
  • Using complete sentences post a detailed response to the following.
    13·1 answer
  • (Java)
    11·2 answers
  • The television is the biggest technological advancement in communication since the telephone.
    6·2 answers
  • Discuss the information justify with two examples<br>​
    11·1 answer
  • If one of the resistors is turned off (I.e. , a light bulb goes out), what happens to the other resistors (light bulbs) in the c
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!