Computer Science, asked by shalini2306, 1 month ago

Find the output of the following.
1. #include<iostream>
using namespace std;
int main()
{
int S=0;
int A[10]={3,2,5,4,7,9,10);
for(int p = 0; p<=6; p++)
{
if(A[p]%2==0)
S = S+A[p];
}
cout<<S;
return 0
}

pls find the output and pls answer it fast

Answers

Answered by kajalpal1975
0

Answer:

16

Explanation:

S is initialized as 0.

A is an array {3, 2, 5, 4, 7, 9, 10}

a loop runs from 0 to 6

A[p] is each element of A. If it is divisible by 2 it is added to S

S = 2 + 4 + 10 = 16

S is printed.

Please mark me as the brainliest.

Similar questions