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
Programmers insert documentation called facts into the program code.? <br> a. True <br> b. False
dedylja [7]
This is true! Documentation is a very important part of readability!
3 0
2 years ago
How can I call moderator in braily app ???
SVETLANKA909090 [29]

Hi

You can directly message them.

And just in case you don't know how to message in brainly, then:

If you are using app, then

• Go to your profile and go in the option followers/following.

• There you'll see an option to search, slick that and search the name of moderators.

• Do to there profile and you'll see 2 options ( given in image attached) 1, to follow and 2nd to message.

click \: the \: 2nd \: optionclickthe2ndoption

And just in case, you are using website, then:

• Go to their profile and you'll see an option saying " write a message", click that and you'll able to message them.

Just in case you don't know the names of moderators of Brainly ( you are new here)

So here are some of them:

• Siddhartharao77

• Nikki57

• Praneethworldtopper

• Anvigottlieb

• RehanAhmadXLX

• Abhi178

• Sugarplumprincess

Hope this helps!!!

Thanks...

☺☺

5 0
2 years ago
Many ____ classes for certification are available on the Internet and by many companies that have set up intranets within their
Marina86 [1]

Many <u>online training</u> classes for certification are made available for students on the Internet and by many companies that have set up intranets within their organizations.

Certification can be defined as a recognition that is given to an individual (student) for the completion of a specific course of study and passing an examination. Thus, it usually issued to certify that an individual is a professional in a particular course of study.

Some examples of certifications that are issued to an individual (student) include the following:

  • CCNA
  • Comptia A+
  • HSE I and II

In this context, many companies with intranet facilities within their organizations offer <u>online training</u> classes for certification by making them available for students over the Internet.

Read more on certification here: brainly.com/question/1391803

5 0
2 years ago
The expectations I would discuss with Erica regarding the usage of the internet
ryzh [129]

Answer:

Tell her about cyber bullies

Tell her about hackers

stalkers

identity theft

spam

Sorry if wrong

Explanation:

8 0
3 years ago
There is a feature that allows you to lock the document, to avoid others making changes. True or False
Burka [1]

Answer:

yes there is

Explanation:

6 0
3 years ago
Other questions:
  • The number of bits used to store color information about each pixel is called ____.
    13·1 answer
  • ____ is a practice where a user in enticed by possible rewards and then asked to provide personal information.
    14·1 answer
  • The code segmentif (speed &lt;= 40)cout &lt;&lt; "Too slow";if (speed &gt; 40 &amp;&amp; speed &lt;= 55)cout &lt;&lt; "Good spee
    11·1 answer
  • Which of the following goals is likely to require funding? Check all that apply.
    6·2 answers
  • Ann needs to share information about a new hiring policy. She needs to communicate this information to more than one hundred emp
    15·2 answers
  • You can get context-sensitive help information from the Code Editor by_________.A) selecting Contents from the Help menu
    9·1 answer
  • In the digital age we have less time to absorb and make sense of new information
    12·2 answers
  • Ben is writing a paper for his college history class, and he wants to include some information he found on a Web site. What are
    5·1 answer
  • Complete the statement below using the correct term.<br>Website managers use<br>every day​
    11·2 answers
  • How can the system administrator give the executive assistant the ability to view, edit, and transfer ownership of all records,
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!