Question

Q1. Write an algorithm (pseudocode or flowchart) for the following problem. Input: Eight integers Output: the sum of even num
1 0
Add a comment Improve this question Transcribed image text
Answer #1

code:
#include<stdio.h>
void main()
{
int sum=0,i;
int a[20];
printf("Enter array elements");
for(int i=0;i<8;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<8;i++)
{
if(a[i]%2==0)
{
sum=sum+a[i];
}
}
printf("%d",sum);
}

O Algorithm: 1 Input: 8 numbers output: sum of even numbers - * Initialize the vray * initialize sum ne 8 * input the element

Flow choot ;- start Sum = 0, izo, n=8 Read values if no ĭ < 8 | Чеg if(182) yes sum= Sum ti iziti Point sum stop CS Scanned w

Add a comment
Know the answer?
Add Answer to:
Q1. Write an algorithm (pseudocode or flowchart) for the following problem. Input: Eight integers Output: the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT