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
List 5 object which are considered part of ICT. explain its function.
UNO [17]

Answer:

Here it is

Explanation:

Processing is not considered as the tool of ICT. Explanation: ICT is Information and Communication Technology. This is one of the trending technologies with new concepts.

7 0
3 years ago
Which of the following statements is not true about the TCP opening and closing of connections?
lubasha [3.4K]

Answer:  c.)

Explanation:

The bit SYN is used in order to synchronize segment numbers in the sender and receiving processes in hosts that are trying to start a data transmitting session between them.

It is initiated by the sending end, that set this bit to " 1", in the TCP header, starting which is known as a "3-way handshake process".

The bit SYN is not used in order to close a connection, the FIN bit is used for this purpose.

If one process set the FIN bit to "1", this means that it has no more data to send.

3 0
3 years ago
In your own words, explain the role of scientific investigation in the development of the Theory of Evolution.
AveGali [126]
The theory of evolution is the product of scientific investigation
7 0
3 years ago
If you cut a piece of text but intended to copy it, what command can you use to correct your error?
Assoli18 [71]

Answer:

It should be undo, as the deleted text is pasted. You can then, copy it.

5 0
4 years ago
Read 2 more answers
Create a named range called, "Savings" that references the cell that calculates the monthly savings in your budget. The savings
Katen [24]
Is this to be done in excel?
3 0
3 years ago
Read 2 more answers
Other questions:
  • The total cost of a DUI could be as high as----- dollars?<br> a100<br> b500<br> c1000<br> d8000
    15·2 answers
  • Assume a 8x1 multiplexer’s data inputs have the following present values: i0=0, i1=0, i2=0, i3=0, i4=0, i5=1, i6=0, i7=0. What s
    8·1 answer
  • What is the result of segmenting a network with a bridge (switch)? (Choose two)
    14·1 answer
  • Describe the difference between fuses and circuit breakers. where might each type of device find its best use? g
    10·1 answer
  • The user interface design principle that places an emphasis on the intuitive flow of the interface (i.e. left to right and top t
    12·1 answer
  • How do you restore deleted notpad++ file?
    12·1 answer
  • Which computer program can you use to write, edit, print, and perform any modifications to a document?
    13·2 answers
  • Linda is training to become a certified network design expert and consultant. While researching about the process of cellular ra
    12·1 answer
  • If a touch screen chrome is not charging what is wrong with it
    13·2 answers
  • David is taking a test. To answer a question, he first covers up the answer choices. Next, he tries to answer the question. Then
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!