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
Write a question that the database will understand. Which records do not contain "sold"?
astraxan [27]

Answer:

b

Explanation:

b

4 0
2 years ago
Which of the following identifies the patterns used for each data series in a chart?
Lady_Fox [76]
The answer is A)Legend.
7 0
3 years ago
What are two distinctive types of unmanned aircraft systems
chubhunter [2.5K]
Probes and Drones
Hope this helps and please give brainliest!
8 0
3 years ago
What is a program file​
Fantom [35]

Answer:

Program Files is the directory name of a standard folder in Microsoft Windows operating systems in which applications that are not part of the operating system are conventionally installed.

Explanation:

7 0
2 years ago
If you want to selectively darken an area of an image you could use the
DerKrebs [107]
Create an adjustment layer and create a hue and saturation layer. You'll see sliders so adjust them to your liking. next select a layer mask and fill it will black. then select which areas you want to darken and use the wand tool. Apply a gradient mask if you want. 
5 0
3 years ago
Other questions:
  • Discuss the differences between dimensionality reduction based on aggregation and dimensionality reduction based on techniques su
    13·1 answer
  • A digital footprint is all of the information on-line about a person posted by that person or others, ____________. intentionall
    14·1 answer
  • ​A(n) ____ will hold an online auction buyer’s payment until he or she is satisfied that the item bought matches the seller’s de
    13·1 answer
  • What is the difference between line art and continuous tone copy?
    14·1 answer
  • Consider Statement 1: All prime numbers greater than 3 are equal to a multiple of six, plus 1 or minus 1. Let P(x) be the statem
    7·1 answer
  • Differences of a desktop computer and a laptop
    13·1 answer
  • 3.
    9·1 answer
  • Heeeeeeeelp :)<br> thx<br> jfdyiusjmkdsuiho;dmcvrvho;j
    5·2 answers
  • Why is computer economics important?​
    10·1 answer
  • // This pseudocode is intended to describe
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!