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]
3 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]3 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
_____ is a valid URL, or internet address. In this URL, ______ indicates the protocol.
Natalija [7]

Answer:

1. B.http://www.example.com

2. A. http

Explanation:

7 0
3 years ago
What is meaning of geo and bio​
Aleks [24]

Answer:

GEO. genetically enhanced organism. Medical, Health, Healthcare.

The word biology is derived from the greek words /bios/ meaning /life/ and /logos/ meaning /study/ and is defined as the science of life and living organisms. An organism is a living entity consisting of one cell e.g. bacteria, or several cells e.g. animals, plants and fungi.

Hope it helps

Explanation:

5 0
3 years ago
Read 2 more answers
Why is it preferable to code web pages in HTML format?
balu736 [363]

Answer:

its c on plato

Explanation:

5 0
3 years ago
How do you protect the server from modification by non-root users?
Elis [28]

Answer:

We can protect the server from the modification by using the non root users in many ways as follows:

  • By modifying the PHP settings in the server and by using the configured file as, the configuration of the file is basically depend upon the linux and the PHP script.
  • By disabling the URL from the function of file handling that basically accept the local file as the parameters but it also accept the URL.  It can even now get to outer destinations by utilizing fsockopen or any of the CURL capacities.
  • The safe mode  of PHP is presumably probably the best alternative to secure your server however it very well may be prohibitive. Whenever initiated, experimental mode averts access to records not claimed by Apache and access to condition factors and execution of double projects are likewise debilitated.

4 0
3 years ago
Write an algorithm for a program which inputs the lengths a, b and c of the three
Dmitriy789 [7]

Hello,

Answer:

<h2>--//Triangles Algorithm</h2>

Declare the variables of the side of each triangle, in this case, a, b, and c, and input them.

If a^2 == b^2 + c^2

           display "This triangle IS right-angled."

Else

          display "This triangle is NOT right-angled

Explanation:

The meaning of the word "algorithm" in this situation would be the coding of the program that you are assigned to create. I'll use Python in this. Display, in this case, will mean "print"

6 0
3 years ago
Read 2 more answers
Other questions:
  • All of the following are search operators EXCEPT _______________. a. AND b. OR c. NOT d. GET
    12·2 answers
  • Each TextField has a text property that's returned by its textProperty method as a StringProperty. The StringProperty method ___
    12·1 answer
  • Which level of education do most peoplebecoming a broadcast analyst obtain?
    13·2 answers
  • Thegroup of technologies concerned with the capturing, processing and transmissionof information in the digital electronic form
    9·1 answer
  • A detective agency is looking to bust an arms sale. According to available intelligence, the sale is likely to happen in one of
    11·1 answer
  • Can someone please help me
    11·1 answer
  • Suppose users share a 1-Gbps link. Also, suppose each user requires 200 Mbps when transmitting, but each user only transmits 30
    5·1 answer
  • What are some random fun facts about Technology?
    12·1 answer
  • ......................... and ....................... are two ways to define the text in Inkscape.
    14·1 answer
  • Read the problem listed below. Formulate a Decomposition or Outline of the problem. Determine if you have seen this problem befo
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!