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
yan [13]
2 years ago
7

WAP to enter a multidigit number and find the sum of only even digits in a number.​

Computers and Technology
1 answer:
daser333 [38]2 years ago
6 0

Following are the program to calculate even digits sum:

<h3>Program:</h3>

#include <iostream>//header file

using namespace std;

int main()//main method

{

   int a[10],s=0,i;//defining an array and an integer variable

   cout<<"Enter array values: ";//print message

   for(i=0;i<=9;i++)//defining a loop that input array value

   {

       cin>>a[i];//input array value

   }

   for(int i=0;i<=9;i++)//defining loop that check array value

   {

       if(a[i]%2==0)//defining if block that checks even number condition value

       {

           s=s+a[i];//adding even number value

       }

   }

   cout<<"The sum of even number is: "<<s;//print even number sum value

   return 0;

}

Program Explanation:

  • Defining a header file.
  • Defining the main method.
  • Inside the main method, an integer array "a", and two integer variable "s,i" is declared.
  • In the next step, a for loop is declared that input the array value, and after input value another loop is declared that check even number value in array.
  • In this loop it adds array value and after adding the value a print method is declared that prints its value.

Output:

Please find the attached file.

Find out more information about the even number here:

brainly.com/question/4184435

You might be interested in
Random access memory is the portion of a computer's primary storage that does not lose its contents when one switches off the po
brilliants [131]

Answer:

False

Explanation:

The RAM does lose its memory when you turn off the computer, unlike hard drive which is slower but keeps memory

4 0
3 years ago
Read 2 more answers
Describe shortly about the following Linux directories and theirpurpose,1. lib2. etc3. Boot4. Root5. home
Bingel [31]

Answer:

 Linux directories and their purposes are:

1) lib - Lib file contained the share object library file which necessary to boots system and this directory contain file module stored in the kernel.

2) etc - etc file is the configuration file that they are local in the machines. When the program run these file are stored in the directories. this can be static and do not executable directory.

3) Boot - Boot file are stored in the directory which required processing of linux boot and such files are included in the linux kernel of the file.

4) Root - Root file are the best user root directory and user cannot view this directories from there account. This file usually contain administrative file system.  

5) Home - Home file contained the user directory and it is the default system of linux. Home directory helps user to enable any network system to access there home directories.

5 0
3 years ago
Why does it say error on that last line of code
wel

Answer:

i have no clue

Explanation:

8 0
3 years ago
Read 2 more answers
The data table provides the results of several what-if analyses, but results are often clearer if you include a(n
r-ruslan [8.4K]
CVP Chart.
Source: "New Perspectives on Microsoft Excel 2010: Comprehensive" by June Parsons, Dan Oja, Roy Ageloff, Patrick Carey.
4 0
3 years ago
_________ products/services are more quickly consumed,usually in a single use or a few usage occasions.
stiks02 [169]

Answer: Non durable

Explanation:

Non durable products/services are more quickly consumed,usually in a single use or a few usage occasions. Examples of these product include daily eatables which has to be consumed within a few days or it will perish and other services such as medical and etc.

4 0
3 years ago
Other questions:
  • Which social media marketing concept engages visitors, getting them to revisit your website and tying them to offline events for
    7·2 answers
  • When an IRET instruction is executed, what actiontakes place?
    5·1 answer
  • Give two examples of desktop publishing software
    7·1 answer
  • With respect to the general classes of computers, a ________ is the most expensive and most powerful kind of computer, which is
    7·1 answer
  • In Python,The sum of the elements in a tuple can be recusively calculated as follows:The sum of the elements in a tuple of size
    5·1 answer
  • One of the most common uses of spreadsheet programs are communicating with others. O editing images and photos. O tracking and m
    8·2 answers
  • According to the video, what qualities do Human Services workers need? Check all that apply.
    11·2 answers
  • What are tributaries
    15·2 answers
  • .... . .-.. .-.. --- .-.-.-<br><br><br> TRANSLATE THAT.
    10·1 answer
  • Write a Java program that will be able to generate the sample table below.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!