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
Brrunno [24]
3 years ago
6

Input 10 integers and display the following:

Computers and Technology
1 answer:
LekaFEV [45]3 years ago
3 0

Answer:

// code in C++

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int sum_even=0,sum_odd=0,eve_count=0,odd_count=0;

   int largest=INT_MIN;

   int smallest=INT_MAX;

   int n;

   cout<<"Enter 10 Integers:";

   // read 10 Integers

   for(int a=0;a<10;a++)

   {

       cin>>n;

       // find largest

       if(n>largest)

       largest=n;

       // find smallest

       if(n<smallest)

       smallest=n;

       // if input is even

       if(n%2==0)

       {  

           // sum of even

           sum_even+=n;

           // even count

           eve_count++;

       }

       else

       {

           // sum of odd    

          sum_odd+=n;

          // odd count

          odd_count++;

       }

   }

   

   // print sum of even

   cout<<"Sum of all even numbers is: "<<sum_even<<endl;

   // print sum of odd

   cout<<"Sum of all odd numbers is: "<<sum_odd<<endl;

   // print largest

   cout<<"largest Integer is: "<<largest<<endl;

   // print smallest

   cout<<"smallest Integer is: "<<smallest<<endl;

   // print even count

   cout<<"count of even number is: "<<eve_count<<endl;

   // print odd cout

   cout<<"count of odd number is: "<<odd_count<<endl;

return 0;

}

Explanation:

Read an integer from user.If the input is greater that largest then update the  largest.If the input is smaller than smallest then update the smallest.Then check  if input is even then add it to sum_even and increment the eve_count.If the input is odd then add it to sum_odd and increment the odd_count.Repeat this for 10 inputs. Then print sum of all even inputs, sum of all odd inputs, largest among all, smallest among all, count of even inputs and count of odd inputs.

Output:

Enter 10 Integers:1 3 4  2 10 11 12 44 5 20                                                                                

Sum of all even numbers is: 92                                                                                            

Sum of all odd numbers is: 20                                                                                              

largest Integer is: 44                                                                                                    

smallest Integer is: 1                                                                                                    

count of even number is: 6                                                                                                

count of odd number is: 4

You might be interested in
_____ is a personal application software that includes a wide range of built-in functions for statistical, financial, logical, d
VladimirAG [237]

Answer:

spreadsheet

Explanation:

<h2><u>Fill in the blanks</u></h2>

<u>spreadsheet</u>  is a personal application software that includes a wide range of built-in functions for statistical, financial, logical, database, graphics, and date and time calculations.

7 0
3 years ago
A destination port number at the transport layer identifies which application on a computer should receive the data transmission
Lady_Fox [76]

A destination port number at the transport layer identifies which software application on a computer should receive the data transmission: True.

<h3>What is the transport layer?</h3>

The transport layer can be defined as one of the seven layers of the open systems interconnection (OSI) model and it is responsible for routing messages through an active computer network while selecting the best transmission path from the source to the destination device.

In Computer networking, a destination port number at the transport layer is saddled with the responsibility of identifying which software application on a computer should receive the data transmission.

Read more on transport layer here: brainly.com/question/26177113

#SPJ12

7 0
1 year ago
The question is provided in the image below.
Vladimir [108]

Answer: b

Explanation:

3 0
2 years ago
Insurance can help you:
AleksAgata [21]
The answer is: D for sure 
7 0
3 years ago
Pitch, frequency, is measured in? ( Computer Science related )
zimovet [89]
Pitch, frequency is measured in Hertz. 

Hope this helps! :)
4 0
3 years ago
Other questions:
  • Does any one play sniper clash 3d ??? ​
    9·2 answers
  • What device provides ports to allow a laptop to easily connect to a full-sized monitor, keyboard, ac power adapter, and other pe
    11·1 answer
  • Science Help
    11·1 answer
  • A _____ can be used to create and test prototypes, develop interfaces, and simulate factory layouts and assembly lines, without
    10·1 answer
  • Please respond not with answer but with comment.
    12·1 answer
  • WILL GIVE BRAINLIEST! 20 POINTS! PLZ HELP!
    14·2 answers
  • What are some signs that could help you determine that a date and time was inserted as a special object instead of
    14·1 answer
  • 2. When a business practices offensive behavior, you have many options. The option with the loudest voice is
    12·1 answer
  • A radio and communications security repairer is responsible for both radio and satellite communication systems.
    6·2 answers
  • What is the best way to use a prototype to better understand yolir audience?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!