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
Archy [21]
2 years ago
10

Write a program that prints the sum of the even numbers and the products of odd numbers on the screen

Computers and Technology
1 answer:
ss7ja [257]2 years ago
4 0

Answer:

The program in Python is as follows:

n = int(input("Number of inputs: "))

total = 0; product = 1

for i in range(n):

   num = int(input(": "))

   if num%2 == 0:

       total+=num

   else:

       product*=num

print("Sum of even: ",total)

print("Product of odd: ",product)

Explanation:

This prompts the user for the number of inputs, n

n = int(input("Number of inputs: "))

This initializes sum (total) to 0 and products to 1

total = 0; product = 1

This iterates through n

for i in range(n):

This gets the inputs

   num = int(input(": "))

If input is even, calculate the sum

<em>    if num%2 == 0:</em>

<em>        total+=num</em>

If otherwise, calculate the product

<em>    else:</em>

<em>        product*=num</em>

Print the required outputs

<em>print("Sum of even: ",total)</em>

<em>print("Product of odd: ",product)</em>

<em />

You might be interested in
When an employee is told that his job will be outsourced within a year, he knows that his job will become unnecessary
Anvisha [2.4K]
False!! Hope this helps
8 0
3 years ago
__________ requires unbiased and careful questioning of whether system elements are related in the most effective ways, consider
Liono4ka [1.6K]

Answer:

The answer is "Critical analysis".

Explanation:

Critical analysis is a part of the operating system, that provides an analysis, which is used to process all bits in a system and run their computer system more efficiently.

  • This analysis is used in contextual writing because It reflects the author's interpretation or perception of the text.
  • This analysis hosts vulnerabilities in current desktop operating systems objectively.
5 0
3 years ago
What is the primary limitation of free versions of antivirus applications?
weqwewe [10]
The correct answer is A because they cant protect in real time
5 0
3 years ago
Match the term to its correct defintion
emmasim [6.3K]

Answer:

View Base tables: Virtual table based on a SELECT query

CREATE VIEW statement: Data definition command that stores the query specification in the data dictionary

DROP VIEW statement: Data definition command that removes the query specification in the data dictionary

Explanation:

Views are virtual tables, which can be created by select queries using the real database tables.

Creating and dropping views can be done by the CREATE VIEW and DROP VIEW statements.

<u>CREATE VIEW syntax:</u>

CREATE VIEW view_name AS

SELECT column1, column2, ...

FROM table_name

WHERE condition;

<u>DROP VIEW syntax:</u>

DROP VIEW view_name;

5 0
3 years ago
Which item below is NOT output? A. monitor B. speakers C. printer D. mouse
Molodets [167]
D. mouse that is  your answer <span />
6 0
3 years ago
Read 2 more answers
Other questions:
  • Nunya is a computer software company that employs highly intelligent, but somewhat unusual people. Every Friday, free lollipops,
    13·1 answer
  • What is the oldest malware victor
    6·1 answer
  • Please helpp!! I need it quickly!
    6·1 answer
  • There is no way to see how another project in Scratch was made.<br><br> True<br> False
    11·1 answer
  • What is one of the most helpful things about having a role model?
    10·2 answers
  • What is it called when there are an equal number of characters on either side of the horizontal center of the page?
    8·1 answer
  • A computer technician is responding to a call about a printer that is causing streaks to appear on every printout. Which of the
    5·1 answer
  • What is media ethics. Explain two forms of maintaining media ethics with examples​
    13·1 answer
  • What are the cloud storage components
    6·1 answer
  • The condition known as __________ occurs when you try to store an integer that is bigger than the maximum allowed by the number
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!