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
FREE POINTS JUST ANSWER MY LATEST TWO QUESTIONS PLEASE
Mekhanik [1.2K]

Answer:

Look down below for answer!

Explanation:

1. The internet has backup files and a greater authoritative figure can easily see the history on the photo, etc. Some apps have save files no matter what and can track the post, photo, and when and why it was deleted. The impression the photo left on people may not be left either.

2. The zoo can be breaking the law because even though they store the information safely, they do not have the visitors consent to having their information.

7 0
3 years ago
Read 2 more answers
Is a book considered technology?
kumpel [21]
Yes, "technology" doesn't have to be all about computers or cell phones.. Technology is anything that is a new advance in knowledge and books were once a great advance in that field.
7 0
3 years ago
Read 2 more answers
Research and discuss the LAMP (Linux, Apache, MySQL, and PHP) architecture. What is the role of each layer of this software stac
Vsevolod [243]

Answer:

Answered below

Explanation:

LAMP is an example of a web service stack. It is used for developing dynamic websites and applications. It's components include;

1) The Linux operating system, which is built on open source and free development and distribution. Types of Linux distributions include: Ubuntu, Fedora and Debian. This operating system is where sites and applications are built on.

2) The Apache HTTP server. Apache server is developed by the Apache software Foundation and is open source. It is the most popular web server on the internet and plays a role in hosting websites.

3) MySQL is a relational database management system that plays a role in the storage of websites data and information.

4) The PHP programming language is a scripting language for web development whose commands are embedded into an HTML source code. It is a popular server-side language used for backend development.

8 0
3 years ago
List 1 reason people invest in Cryptocurrency
Katarina [22]

Answer:

The common reason to invest in cryptocurrency is the desire for a reliable, long-term store of value.

Explanation:

8 0
2 years ago
A user profile has a login hour restrictions set to. Monday through A user profile has login hour restrictions set to. Monday th
Savatey [412]

Answer:

D

Explanation:

The user will be logged out and any unsaved work-in-progress will be lost.

In a computer program if a user has login hour restrictions this means that such a user will not be able to continue with his/her work when its past the restriction time.

Therefore at 5.01 pm the user will be logged out and any unsaved work-in-progress will be lost.

8 0
2 years ago
Other questions:
  • A(n) ________ signal is a discrete, binary waveform that transmits data coded into two discrete states such as 1-bits and 0-bits
    12·1 answer
  • It is generally safe to provide your social security number to
    7·2 answers
  • You are tasked with accumulating survey data on a web page and are responsible for it being free from dirty data once you close
    11·1 answer
  • technology might not possess emotional intelligence but it can certainly influence ours. how have technological changes affected
    7·1 answer
  • When a bank account pays compound interest, it pays interest not only on the principal amount that was deposited into the accoun
    10·1 answer
  • Gigantic Life Insurance is organized as a single domain. The network manager is concerned that dividing into multiple domains to
    15·1 answer
  • If I'm screen sharing and I plug in a HDMI, will it screen share what the HDMI is plugged into, and can you talk at the same tim
    11·1 answer
  • Question #4
    10·1 answer
  • Compare and contrast the advantages and disadvantages of a LAN to a WLAN.
    8·1 answer
  • Which of the following tabs on the Ribbon contains the commands for adding tables, pictures and shapes into a publication? Quest
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!