Can anyone know what program what's the best for this problem?
-->Create a program that will compute for the sum of all even numbers among the ten integers inputted and print them out.
Thanks in advance!:)
Can anyone know what program what's the best for this problem?
-->Create a program that will compute for the sum of all even numbers among the ten integers inputted and print them out.
Thanks in advance!:)
Homework? Here is where to start
#include <stdio.h>
int main()
{
// put your code here
}
just make a loop for that!!!
its just a simple problem....you can do it just trust your intelegence
You can try this........I took the labor to not take input for my convinience
#include<stdio.h>
void main()
{
int n[]={1,2,3,4,5,6,7,8,9,10};
int i , total;
total=0;
for(i=0;i<10;i++)
{
if(n[i]%2==0) //Checking for even numbers
total = total + n[i];
}
printf("%d",total);
}
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.