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
Marty uses a customized database to sort parts and track inventory. The customized database is an example of _____.
Alexeev081 [22]

cataloging is a term for that

5 0
3 years ago
Identify the careers that require a college degree
Vikentia [17]
Doctor or teacher or an engineer

8 0
2 years ago
. When would one use the analytic application fraud detection?
vaieri [72.5K]

Answer:Fraud detection through analytical method is used for detection of the fraud transactions,bribe activity etc in companies, business,etc. This techniques helps in the reduction of financial frauds in the organization, have the control over company to protect it,decrease in the fraud associated costs etc.

It has the capability of identifying the fraud which has happened or going to happen through the analytical ways and human interference. The organizations or companies require efficient processing and detection system for identification of such false happening.

4 0
3 years ago
Edhesive 6.8 lesson practice answers
FromTheMoon [43]

Answer:

1.) 25 ; 15 ; 15

2.) 50 ; 15 ; 50

Explanation:

In the first function written :

The variable val was initially decaled or assigned a value of 25 and that was what was printed first.

However, after the example function was written, the val variable was finally assiagned a value of 15 within the function. However, it was also declared that the global variable takes uonthe val value. Hence, the val variable initially assigned a value, of 25 changes to 15 globally.

For the second code :

From the top:

Val was assigned a value of 50 ;

Hence,

print(val) gives an output of 50

Within the function definition which prints the value of val that is assigned a value of 25 within the function.

Since tbe global variable isnt reset.

Printing Val again outputs 50;since ito is outside the function.

6 0
2 years ago
Levi wants to run 5 commands sequentially, but does not want to create a shell script. He knows that each command is going to ta
sergeinik [125]

Answer:

um

Explanation:

what subject is this again?

3 0
2 years ago
Other questions:
  • Write a method named lastFirst that accepts a string as its parameter representing a person's first and last name. The method sh
    13·1 answer
  • What is an unique text-based internet address corresponding to a computer's unique numeric IP address called
    8·1 answer
  • Template files can contain the following items: text, tables, images and lists.
    10·1 answer
  • How many fonts are there in a theme?<br> A. 1<br> B. 2<br> C. 4<br> D. 5
    10·1 answer
  • Micheal has increased the contrast of the given picture. Which feature or menu option of a word processing program did he use? A
    15·1 answer
  • Draw a logic circuit for the function F = (A + B)(B + C)(A + C), using NOR gates only. ​
    9·1 answer
  • Dayla is concerned about managing her digital footprint. What does she mean by this? *
    7·1 answer
  • . Some countries lack physical resources, like computers or network connections, making it difficult to keep up with the technol
    8·2 answers
  • Vannevar Bush imagined a desktop computing machine that would allow people to access data stored in various information centers
    13·1 answer
  • how do I delete my brainly account, my child signed up for it and nothing has been paid but I do not want the account to exist a
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!